-
Notifications
You must be signed in to change notification settings - Fork 204
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
Great difference between train and test. #13
Comments
Hi, Not sure what you call test set here. We perform validation during training, and validation set is being generated randomly according to val_split (=0.1) and random seed. |
@alexander-rakhlin Thanks for your response. Here is the code that can reproduce the problem. The performance becomes not very good. ` model_variation = 'CNN-non-static' sequence_length = 56 batch_size = 32 min_word_count = 1 print("Loading data...") if model_variation=='CNN-non-static' or model_variation=='CNN-static': shuffle_indices = np.random.permutation(np.arange(len(y))) x_train = x_shuffled[:int(len(y)*2/3)] graph_in = Input(shape=(sequence_length, embedding_dim)) if len(filter_sizes)>1: graph = Model(input=graph_in, output=out) model = Sequential() model.compile(loss='binary_crossentropy', optimizer=opt, metrics=['accuracy','precision','recall','fbeta_score']) |
Provided random seed is the same, both runs should give you the same test set. And model you use on test stage seems the same too. So I don't know how it gives different results. Try to debug and in the first place verify test set is the same. As an ultimate measure you can compare model weights on both stages. |
@alexander-rakhlin Thanks for your help. |
Thanks for sharing the code.
I have a question of the performance.
After we comment the codes of 'Train' and 'Save model':
Almost 10% gap, I guess that the training dataset is grouped with test set in some functions.
Here is a similar problem in cnn-text-classification-tf:
dennybritz/cnn-text-classification-tf#63
Thanks!
The text was updated successfully, but these errors were encountered: