Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CamDavidsonPilon/1f59682876c47266df8467cf7a0423d4 to your computer and use it in GitHub Desktop.
Save CamDavidsonPilon/1f59682876c47266df8467cf7a0423d4 to your computer and use it in GitHub Desktop.
for _ in range(10):
v = np.random.uniform(-10, 10, size=2)
print(check_grad(_negative_log_likelihood, gradient_function, v, log(T), E), v)
"""
0.4712740782685882 [-6.56058891 5.14902935]
3237.6524450846837 [ 9.08538372 -1.41142257]
0.49837258718119815 [6.07499167 8.61057025]
5521.168518284348 [ 9.87185318 -1.53403377]
nan [ 4.8854386 -2.92944677]
0.49734961694385993 [-8.77198502 8.67598151]
7.828729058848824 [9.42957936 0.70898664]
nan [-2.48981841 -2.49967818]
nan [-5.34669948 -1.99228551]
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment