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

No shuffling of examples in introduction notebook #54

Open
lamblin opened this issue Nov 6, 2020 · 2 comments
Open

No shuffling of examples in introduction notebook #54

lamblin opened this issue Nov 6, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@lamblin
Copy link
Collaborator

lamblin commented Nov 6, 2020

We realized that in the introduction notebook, the usage examples given for the make_multisource_episode_pipeline did not set the shuffle_buffer_size parameter, which defaults to not shuffling examples within each class.

Two unfortunate consequences we identified in code that would not shuffle examples are:

  • Evaluation on the traffic_sign dataset were overly optimistic, since the examples were organized as 30-image sequences of pictures from the same physical sign (successive frames from the same video), leading to support and query examples being more frequently really close.
  • Training on small datasets can be worse, since the first examples of a given class would always tend to be support examples, and the later ones would be query examples, reducing the diversity of episodes.

Code using the training loop of Meta-Dataset was not affected, since it gets its shuffle_buffer_size value from a DataConfig object set from a gin configuration that is explicitly passed to Trainer's constructor (in all.gin and imagenet.gin).

We have mitigated the first point by updating the dataset conversion code to shuffle the traffic_sign images once (3512a82), and updated the notebook to show a better practice (c3f62a1), but existing datasets, and code inspired from the notebook (outside of this repository) are still impacted.

Similarly, make_multisource_batch_pipeline does not pass a shuffle_buffer_size, but the impact seems much smaller (batch training should be less sensitive to the order of examples, and the random mixing of different classes adds randomness already).

@lamblin lamblin added the bug Something isn't working label Nov 6, 2020
@lamblin
Copy link
Collaborator Author

lamblin commented Dec 15, 2020

The validation procedure on unshuffled examples may also produce biased results, depending on how it was carried out, which could lead to sub-optimal results.

@lamblin
Copy link
Collaborator Author

lamblin commented Dec 17, 2020

To clarify further: the code in the notebook does not create the DataConfig object, neither explicitly nor implicitly, so setting DataConfig.shuffle_buffer_size does not have any effect when calling pipeline.make_..._pipeline().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant