Skip to content

Instantly share code, notes, and snippets.

View justcallmewilliam's full-sized avatar
🎯
Focusing

William_Guo justcallmewilliam

🎯
Focusing
View GitHub Profile
@justcallmewilliam
justcallmewilliam / check_convex.py
Created December 23, 2019 00:27 — 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