ajbrock / BigGAN-PyTorch

The author's officially unofficial PyTorch BigGAN implementation.
MIT License
2.84k stars 470 forks source link

Query about orthogonal regularization implementation #90

Open TanYingHao opened 2 years ago

TanYingHao commented 2 years ago

Hi, I was looking through this code for reimplementation for a separate task, but I noticed that the orthogonal regularization is implemented by adding the gradient of modified orthogonal regularization loss to the parameters. Shouldn't it be a subtraction for gradient descent. Appreciate any advice :)

I am looking at specifically this code snippet in utils.py w = param.view(param.shape[0], -1) grad = (2 * torch.mm(torch.mm(w, w.t())