def costf(y_pred,y_true):
d = y_pred - y_true
result = tf.cond( d < 0, lambda: 1, lambda: 0)
if(y_pred < y_true ):
error= tf.math.exp(-d/13)-1
else :
error= tf.math.exp(d/10)-1
return error
ValueError:形状必须为0级,但输入形状为[?,?],[?,?]的'loss_26 / dense_26_loss / cond / Switch'(op:'Switch')的等级为2。