i use CNN model for a regression problem with a custom loss
def loss_M2(y_true,y_pred):
y_true_f=K.flatten(y_true)
y_pred_f=K.flatten(y_pred)
M2=K.max(K.abs(K.cumsum((y_pred_f-y_true_f),axis=0)))
return M2
ISSUE : when i call y_train_predict = model.predict(X_train, verbose=0) and evalaute the loss i get "926" instead of something close to 200 that we see on the image above , here is the numpy function that compute the same custom loss
def score_M2(reel,pred):
return max(abs(np.cumsum(reel-pred)))
PS : i checked that the loss_M2 and score_M2 give the same results for the same inputs. Please tell me what is happening here.
