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 2tream gan! #12

Open
dinggd opened this issue Apr 2, 2018 · 4 comments
Open

Question about 2tream gan! #12

dinggd opened this issue Apr 2, 2018 · 4 comments

Comments

@dinggd
Copy link

dinggd commented Apr 2, 2018

Hi Zhedong,

I understand that you use 2 stream (Siamese) network for verification besides classification. However, one question is that how do you deal with gan generated images when performing verification? Did you just consider all generated images belong to the same identity (0 in your case), since I have not found any code specifically dealing with GAN generated images?

Thanks,
Guodong

@dinggd dinggd closed this as completed Apr 2, 2018
@dinggd dinggd reopened this Apr 2, 2018
@dinggd
Copy link
Author

dinggd commented Apr 2, 2018

Sorry about the confusion that I first closed and the reopened this issue. I have found your relative reply under a closed issue saying GAN generated images are not used when performing verification which partly solved my question. Still, I haven't found any code ruling out GAN generated images when composing batch or in final verification loss definition .m file.
Is it because this rep is not up2date?

Thanks,
Guodong

@layumi
Copy link
Owner

layumi commented Apr 4, 2018

Hi @gddingcs ,

Sorry for the late response.

There is a small trick.
If the label is 0, the matconvnet will not calculate the softmax loss.
https://github.com/vlfeat/matconvnet/blob/master/matlab/vl_nnloss.m#L154
For the original GAN paper, I reload the meaning of 0 . So matconvenet will identify the generated images and real image, and calculate the GAN loss.
For the 2-stream, I still use the 0 for the GAN loss (yes, it still works), and simply set 0 for the verification loss (softmax loss, it will ignore).
https://github.com/layumi/Person-reID_GAN/blob/master/train_id_net_res_2stream_gan.m#L63

@dinggd
Copy link
Author

dinggd commented Apr 4, 2018

Thanks for the clearification.

So you are first calculating every pair normally and then assign 0 instanceweight for those pairs contain either single fake image or both are fake, thus they are excluded.

And by GAN loss you meant LSRO?

@layumi
Copy link
Owner

layumi commented Apr 5, 2018

Hi @gddingcs
Yes. If you use 0 for softmax loss (verification loss), the instance weight will be 0. So the network will not calculate the loss for the pair.

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