def sparse_categorical_crossentropy(y_true, y_pred):
 y_true = tf.cast(y_true, tf.int64)
 y_pred = logit(tf.cast(y_pred, tf.float32))
 return tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(y_pred, y_true))

def sparse_categorical_crossentropy ( y_true , y_pred ) : y_true = tf . cast ( y_true , tf . int64 ) y_pred = logit ( tf . cast ( y_pred , tf . float32 ) ) return tf . reduce_mean ( tf . nn . sparse_softmax_cross_entropy_with_logits ( y_pred , y_true ) )
categorical crossentropy between an output tensor and a target tensor .