Skip to content

Instantly share code, notes, and snippets.

@StevenReitsma
Created February 23, 2018 11:56
Show Gist options
  • Save StevenReitsma/19e160b6fbb1e8109d6b401f83e3ea4f to your computer and use it in GitHub Desktop.
Save StevenReitsma/19e160b6fbb1e8109d6b401f83e3ea4f to your computer and use it in GitHub Desktop.
Blogpost-Heineken10
def neg_sq_loss(labels, preds):
a = -0.1
err = preds - labels
grad = 2 * err * (np.sign(err) + a)**2
hess = 2 * (np.sign(err) + a)**2
return grad, hess
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment