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

trainloader issues #12

Open
CandiceUIC opened this issue Oct 17, 2018 · 5 comments
Open

trainloader issues #12

CandiceUIC opened this issue Oct 17, 2018 · 5 comments

Comments

@CandiceUIC
Copy link

Hey I saw you updated your work recently, that is so nice of you.

I got a question about trainloader here. As I posted before, when I ran your code on my own computer, the loss function is increasing. The problem may be the trainloader. I found that in each epoch, the train loader only load about 480 images which is strange. The number of iterations in each epoch is only 6. I was trying to fix it by myself but it looks a little bit difficult to fully understand your code. Do you have any suggestions for me to fix this problem?

Cheers
Candice

@bnu-wangxun
Copy link
Owner

For every epoch, we do not use all the samples. We just randomly choose K (num_instances in the code) samples from each classes. So only 6 iterations for every epoch.

For the problem of loss function, I need to see your log to know the problem.

Ps: pytorch version is required to be 0.2.30

@CandiceUIC
Copy link
Author

Thanks for your reply.
The version of pytorch I am using is 0.2.30. If you say that 6 iterations is correct, I would say that the codes are running well on my computer.
I am just a little bit curious why each epoch does not go through all the training set. That is a little bit weird to me.

@bnu-wangxun
Copy link
Owner

  1. For easy Implementation, and the performance is good.
  2. PK (P classes , K samples/class) minibatch. Since the number of samples in every class is different, it is hard to go through all the train set.

@bnu-wangxun
Copy link
Owner

@CandiceUIC Have you reached the performance as me?

@CandiceUIC
Copy link
Author

@bnulihaixia For the Binomial Loss, I did reached a performance like you posted. But for other losses, for example triplet, I did not. I think that might be the reason of parameter choosing. I am now working on it.

Anyway, thank you so much for posting your work!

cheers

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