Last active
May 15, 2019 18:24
-
-
Save acl21/de0495b4f2cdc9f935d88a9422861091 to your computer and use it in GitHub Desktop.
Stochastic Gradient Descent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def do_stochastic_gradient_descent(): | |
w, b, eta, max_epochs = init_w, init_b, 1.0, 100 | |
for i in range(max_epochs): | |
dw, db = 0, 0 | |
for x,y in zip(X,Y): | |
dw += grad_w(w, b, x, y) | |
db += grad_b(w, b, x, y) | |
w = w - eta * dw | |
b = b - eta * db |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment