Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Add Comment
Please, Sign In to add comment