Skip to content

Instantly share code, notes, and snippets.

View tianlinyang's full-sized avatar

Tianlin Yang tianlinyang

  • Beijing Language and Culture University
View GitHub Profile
@tianlinyang
tianlinyang / check_convex.py
Created January 6, 2020 02:15 — forked from mblondel/check_convex.py
A small script to get numerical evidence that a function is convex
# Authors: Mathieu Blondel, Vlad Niculae
# License: BSD 3 clause
import numpy as np
def _gen_pairs(gen, max_iter, max_inner, random_state, verbose):
rng = np.random.RandomState(random_state)
# if tuple, interpret as randn