elvisyjlin / AttGAN-PyTorch

AttGAN PyTorch Arbitrary Facial Attribute Editing: Only Change What You Want
MIT License
248 stars 61 forks source link

How to debug def trainG(self, img_a, att_a, att_a_, att_b, att_b_): ??? #11

Closed c1a1o1 closed 5 years ago

c1a1o1 commented 5 years ago

How to debug def trainG(self, img_a, att_a, atta, att_b, attb): ???

elvisyjlin commented 5 years ago

I cannot understand your question. What problems did you encounter?

c1a1o1 commented 5 years ago

When I debug, the function def trainG is automatically ignored???

elvisyjlin commented 5 years ago

It is called here. After several updates of D (normally it is 5 times), G is then updated.

c1a1o1 commented 5 years ago

self.G.train()          self.D.train() What will these two functions do? Thank you for your reply.

elvisyjlin commented 5 years ago

If you have read the paper, the overall objective functions are listed in Section III, Overall Objective. on the fifth page.

A GAN evolves like a min-max game, where D tries to maximize an objective function whilst G attempts to minimize it. So they are updated in turn and help each other grow iteratively. If you are not familiar with GAN, please read some articles or papers about it.

However, if you just use a pretrained model, these functions are not called at all. Because the model has been trained to generate plausible human face images. There is no need to update the weights of the model.

c1a1o1 commented 5 years ago

Thank you for your reply. I get it!

elvisyjlin commented 5 years ago

You’re welcome! By the way, have you found out what the problem is in the other issue you opened?

c1a1o1 commented 5 years ago

Thank you for your reply. I fixed it!

elvisyjlin commented 5 years ago

I’m glad to hear that!