Created
July 17, 2018 16:35
-
-
Save alexbw/4324938e06283f4f550ee61ef4f56055 to your computer and use it in GitHub Desktop.
Auto-generated graph code for 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
def tf__huber_loss(a): | |
with tf.name_scope('huber_loss'): | |
def if_true(): | |
with tf.name_scope('if_true'): | |
loss = a * a / 2 | |
return loss, | |
def if_false(): | |
with tf.name_scope('if_false'): | |
loss = delta * (tf.abs(a) - delta / 2) | |
return loss, | |
loss = ag__.utils.run_cond(tf.less_equal(tf.abs(a), delta), if_true, | |
if_false) | |
return loss |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment