underneeth you can find my custom loss function.
def custom_loss_function(y_true, y_pred): y_pred_bool = tf.math.less_equal(y_pred, tf.constant(0.5)) y