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

The training loss is decreasing while the validation loss is increasing #6

Closed
WhiteLie98 opened this issue Dec 20, 2021 · 4 comments
Closed

Comments

@WhiteLie98
Copy link

WhiteLie98 commented Dec 20, 2021

Sorry to bother you again. I use the pretrain model of yours and run the train_classifier.py. I visualized the log by tensorboard and found the training loss is decreasing while validation loss is increasing. I wonder if the model is overfitting?

@WhiteLie98 WhiteLie98 changed the title The training loss The training loss are decreasing while the validation loss are increasing Dec 20, 2021
@WhiteLie98 WhiteLie98 changed the title The training loss are decreasing while the validation loss are increasing The training loss is decreasing while the validation loss is increasing Dec 20, 2021
@WhiteLie98
Copy link
Author

a9c8204d9aaa64259e1d1bc423f8b25
These are the results of logs.

@IcarusWizard
Copy link
Owner

IcarusWizard commented Dec 20, 2021

Yes, the model is overfitting since cifar10 is a small dataset and we did not perform any data augmentation.

If you wonder why the accuracy is still increasing too, that is because the model is trading accuracy with the cost of perplexity. That is it gets less certain about the right classification, e.g. decrease the probability from 0.9 to 0.6, but get more things right.

@WhiteLie98
Copy link
Author

I see. And where should I extend the dataset by using data augmentations? In the pretrain program or fine-tuning program?
p.s. I'm sorry to ask such questions as this was the first CV program I run.

@IcarusWizard
Copy link
Owner

You can add data augmentations when defining the dataset, i.e. changing the transform from here. Something like RandomResizedCrop should be very helpful. But unfortunately, I do not have the computation resource to verify.

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