Created
November 6, 2020 17:26
-
-
Save enochkan/4193587d614808485be984d49ed5cdf2 to your computer and use it in GitHub Desktop.
loss and grad funcs
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 loss_function(m): | |
return m**2-2*m+1 | |
## take derivative | |
def grad_function(m): | |
return 2*m-2 | |
def check_convergence(w0, w1): | |
return (w0 == w1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment