Skip to content

Instantly share code, notes, and snippets.

@enochkan
Created November 6, 2020 17:28
Show Gist options
  • Save enochkan/8352a7f77d46e2d43269c024870bc55b to your computer and use it in GitHub Desktop.
Save enochkan/8352a7f77d46e2d43269c024870bc55b to your computer and use it in GitHub Desktop.
testing adam optim
w_0 = 0
b_0 = 0
adam = AdamOptim()
t = 1
converged = False
while not converged:
dw = grad_function(w_0)
db = grad_function(b_0)
w_0_old = w_0
w_0, b_0 = adam.update(t,w=w_0, b=b_0, dw=dw, db=db)
if check_convergence(w_0, w_0_old):
print('converged after '+str(t)+' iterations')
break
else:
print('iteration '+str(t)+': weight='+str(w_0))
t+=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment