Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable to reproduce loss value of training when predicting CNN #334

Open
ztarboun opened this issue Dec 5, 2018 · 1 comment
Open

enable to reproduce loss value of training when predicting CNN #334

ztarboun opened this issue Dec 5, 2018 · 1 comment

Comments

@ztarboun
Copy link

ztarboun commented Dec 5, 2018

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.

@BenjaminBossan
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants