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

Are images sorted in the classes? #4

Open
dsmic opened this issue Aug 19, 2019 · 3 comments
Open

Are images sorted in the classes? #4

dsmic opened this issue Aug 19, 2019 · 3 comments

Comments

@dsmic
Copy link
Contributor

dsmic commented Aug 19, 2019

I use the files from the "Download Processed Images" (the tar file).

To me it seems that the images become sorted using MiniImageNetDataLoader, and the first images for each label are simpler to classify than later ones?

If I use shuffle = True at the end of the middle line (there are three occurrences of such lines)

  random.shuffle(sampled_character_folders)
  labels_and_images = self.get_images(sampled_character_folders, range(self.way_num), nb_samples=self.num_samples_per_class, shuffle=False)
  labels = [li[0] for li in labels_and_images]

it is much more difficult to train the data.

I got suspicious because the default in

def get_images(self, paths, labels, nb_samples=None, shuffle=True):

which is overwritten in the call.

@yaoyao-liu
Copy link
Owner

yaoyao-liu commented Aug 19, 2019

Thanks for your interest in this project.

If you use the default libraries of TensorFlow or PyTorch to build the deep neural networks, the order of samples in a single batch will be ignored. So the default setting for shuffle is False. You could set it True. It depends on your code.

If you hope to see an example of how this repo work in a real case, you may see: Meta-Transfer Learning.

@dsmic
Copy link
Contributor Author

dsmic commented Aug 19, 2019

Thanks a lot for the very fast reply. I had an ugly error in my code which lead this assumption...

@yaoyao-liu
Copy link
Owner

Welcome. Feel free to create another issue if you have other questions.

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