nolearn icon indicating copy to clipboard operation
nolearn copied to clipboard

enable to reproduce loss value of training when predicting CNN

Open ztarboun opened this issue 6 years ago • 1 comments

Hello, 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

1

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.

ztarboun avatar Dec 05 '18 11:12 ztarboun

My first guess would be that the data you validate on is not the same as the internal validation data, is that possible? If so, I would try to check the score on exactly the same data.

Out of curiosity, do you use keras in conjunction with nolearn?

BenjaminBossan avatar Dec 09 '18 11:12 BenjaminBossan