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

Question about batching function #1

Closed
gautamb85 opened this issue Feb 11, 2018 · 1 comment
Closed

Question about batching function #1

gautamb85 opened this issue Feb 11, 2018 · 1 comment
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@gautamb85
Copy link

Hello,

I have been trying to implement prototypical networks on a different dataset (audio), and I have been having some difficulty with training, my loss seems to be reducing very slowly.

I had a question about your batching function. If we assume there are 32 query points in a batch, and 3-5 support points per class.

Is each query point getting a label (1-32) and is this arbitrary? Or are datapoints given labels based on the whole training set?
Put in another way, Does a given query point get the same label (necessarily) in different mini-batches.
If you could give me an example that would be super helpful.

Thanks,
Gautam

@dnlcrl dnlcrl added help wanted Extra attention is needed question Further information is requested labels Feb 11, 2018
@dnlcrl
Copy link
Contributor

dnlcrl commented Feb 11, 2018

Hi @gautamb85,

I'm not sure if I understand you correctly, both query and supports points are extracted by calling the dunder method__getitem__ of your dataset class, the batching function (the sampler) simply returns a list of indexes idx, so each point has its corresponding label independently of it being support or query.

Check the PyTorch documentation for more info about Dataset, DataLoader and Samplers:
http://pytorch.org/docs/master/data.html

@dnlcrl dnlcrl closed this as completed Feb 11, 2018
@dnlcrl dnlcrl reopened this Feb 11, 2018
@dnlcrl dnlcrl closed this as completed Feb 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants