pytorch-spectral-normalization-gan icon indicating copy to clipboard operation
pytorch-spectral-normalization-gan copied to clipboard

does it use w_bar when update u and v?

Open Zzlongjuanfeng opened this issue 6 years ago • 3 comments

in the function _update_u_v(self), does it use w_bar rather than w to update u and v? I mean, should i replace w = getattr(self.module, self.name + '_bar') with w = getattr(self.module, self.name).

Zzlongjuanfeng avatar Jun 14 '18 10:06 Zzlongjuanfeng

That seems reasonable, since the current code appears to be doing a single power iteration update. The original paper indeed updates the most recent w. Have you tried running the code with that modification?

Thanks for pointing this out.

On Jun 14, 2018, at 6:42 AM, zengxianfang [email protected] wrote:

in the function _update_u_v(self), does it use w_bar rather than w to update u and v? I mean, should i replace w = getattr(self.module, self.name + '_bar') with w = getattr(self.module, self.name).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

christiancosgrove avatar Jun 14 '18 11:06 christiancosgrove

emmm, not yet. But in the pytorch Implementation, they use the most recent w beacuse they update the weight itself in the line 33.

Zzlongjuanfeng avatar Jun 14 '18 13:06 Zzlongjuanfeng

you're not supposed to update the weight itself, you're supposed to re-normalize the value everytime before using it, without saving the normalization. See Algorithm 1, p15 of the paper

JulesGM avatar Jun 26 '18 15:06 JulesGM