Skip to content

Instantly share code, notes, and snippets.

@alexbw
Last active July 17, 2018 16:34
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 alexbw/17d4295afcec739084960d2032edfff2 to your computer and use it in GitHub Desktop.
Save alexbw/17d4295afcec739084960d2032edfff2 to your computer and use it in GitHub Desktop.
Huber Loss
def huber_loss(a):
if tf.abs(a) <= delta:
loss = a * a / 2
else:
loss = delta * (tf.abs(a) - delta / 2)
return loss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment