Last active
March 14, 2020 21:15
-
-
Save ethanyanjiali/a0ee15922ec029fc8cabd979f249294d to your computer and use it in GitHub Desktop.
HG 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
# vanilla version | |
loss += tf.math.reduce_mean(tf.math.square(labels - output)) | |
# improved version | |
weights = tf.cast(labels > 0, dtype=tf.float32) * 81 + 1 | |
loss += tf.math.reduce_mean(tf.math.square(labels - output) * weights) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment