Created
July 17, 2018 16:34
-
-
Save alexbw/50be489e277b7f63467f053846a049d8 to your computer and use it in GitHub Desktop.
AutoGraph Huber Loss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@autograph.convert() | |
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