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

About "getting_started.ipynb" #52

Closed
KarahanS opened this issue May 12, 2024 · 4 comments
Closed

About "getting_started.ipynb" #52

KarahanS opened this issue May 12, 2024 · 4 comments

Comments

@KarahanS
Copy link

Hi there,

Why did we use batch_size * 2 when we initialize the dataloaders in the following part:

train_loader = data.DataLoader(dataset=train_dataset, batch_size=BATCH_SIZE, shuffle=True)
train_loader_at_eval = data.DataLoader(dataset=train_dataset, batch_size=2*BATCH_SIZE, shuffle=False)
test_loader = data.DataLoader(dataset=test_dataset, batch_size=2*BATCH_SIZE, shuffle=False)

Also, why did we use the train_dataset for evaluation during training as well? Wouldn't it be a better practice to use val split of the dataset? Is there a specific reason for your choices?

@aymuos15
Copy link

  1. The bigger batch size is just for faster inference.
  2. Regarding evaluation, I imagine its simply to gauge train vs test.

@KarahanS
Copy link
Author

KarahanS commented May 13, 2024

Using the same training set for validation during training doesn't really make sense though. The idea is that we have to use samples that the model hasn't seen before and measure the metrics on it.

@aymuos15
Copy link

Yeah, that's fair. Waiting to see their reply for that I guess now haha.

@duducheng
Copy link
Member

Hi guys,

I purely agree with @aymuos15 ‘s reply. ;)

The batch size is only for faster inference. We also monitor the training set performance because the metrics on the whole training set is more consistent than those monitored on training batches. I guess it’s a standard practice especially for research projects which need reporting in the papers.

Nevertheless, it’s only a design choice that has no direct impact on model performances. Feel free to customize your training pipeline, or you can also integrate with popular training framework like PyTorch Lightning.

Jiancheng

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

3 participants