Skip to content

Instantly share code, notes, and snippets.

View ryanpdwyer's full-sized avatar

Ryan Dwyer ryanpdwyer

View GitHub Profile
@jcmgray
jcmgray / sgd-for-scipy.py
Created June 18, 2020 19:33
Stochastic gradient descent functions compatible with ``scipy.optimize.minimize(..., method=func)``.
import numpy as np
from scipy.optimize import OptimizeResult
def sgd(
fun,
x0,
jac,
args=(),
learning_rate=0.001,