def squared_hinge(y_true, y_pred):
 y_true = tf.cast(y_true, tf.float32)
 y_pred = tf.cast(y_pred, tf.float32)
 return tf.reduce_mean(tf.square(tf.maximum((1.0 - (y_true * y_pred)), 0.0)))

def squared_hinge ( y_true , y_pred ) : y_true = tf . cast ( y_true , tf . float32 ) y_pred = tf . cast ( y_pred , tf . float32 ) return tf . reduce_mean ( tf . square ( tf . maximum ( ( 1.0 - ( y_true * y_pred ) ) , 0.0 ) ) )
squared hinge loss .