Skip to content

Instantly share code, notes, and snippets.

@phil8192
Created April 3, 2020 20:56
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 phil8192/c3d50a457963e1c3fa7b93dda1f0d578 to your computer and use it in GitHub Desktop.
Save phil8192/c3d50a457963e1c3fa7b93dda1f0d578 to your computer and use it in GitHub Desktop.
def taylor_loss(theta, x, y):
wx = np.dot(x, theta)
return 1/x.shape[0] * np.sum(np.log(2) - 0.5 * y * wx + 0.125 * wx**2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment