Skip to content

[discussion] SpectralNorm behavior in eval() and at remove() #8208

@ssnl

Description

@ssnl
  1. net.eval():
    Currently, even in eval time, our forward pre hook still does power iteration and updates weight_u. This means that the function the network represents is changing as we test on more and more images! Certainly this shouldn't be desired, despite that the original code has this behavior. The question is what the correct behavior is. Should we just skip the power iteration, i.e. only compute _v and not a new _u?

  2. sn_handle.remove():
    We currently set the weight parameter to the saved weight_orig, i.e., the un-normalized weight, at removing SN. I don't think that this is correct either, because the effective weight is now weight_orig / sigma(weight) and this removal drastically changes the network behavior. I propose to set the weight parameter to result of compute_weight(), and maybe also with power iteration skipped.

@crcrpar @t-vi @fmassa Let me know what you guys think. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions