parthagrawal02/MAE_GAN

Adaptive weight and gradient.

Opened this issue · 0 comments

Thank you so much for sharing the implementation of the MAE-GAN paper. I've been working on a project that benefits from this architecture, and your code serves as an invaluable reference. However, I've some questions regarding the implementation of the adaptive weight implementation.

In L41-45, adap_weight.py, the gradient of the parameters has been assigned by grad_real_tensor[index] + adaptive_weight * grad_fake_tensor[index]. So I think the next step is just to call the optimizer.step() to update the parameter.

However, in L65, engine_pretrain.py, there appears to be an additional accumulation of the gradient through another backpropagation call. This effectively seems to double the learning rate for the auto-encoder. While this might not present a problem in practice, I wanted to clarify this point to ensure I haven't overlooked anything.