Towards Data Science, Artificial Intelligence, TensorFlow, Machine Learning, Deep Learning.
threshold small_error_loss = tf.square(error) / 2 big_error_loss = threshold * (tf.abs(error) - (0.5 * threshold)) return tf.where(is_small_error, small_error_loss, big_error_loss) return my_huber_loss In this case, the threshold value is not hardcoded. Rather we can pass the threshold value during