Skip to content

Commit

Permalink
update Spectral Normalization Code (apache#13868)
Browse files Browse the repository at this point in the history
* update sn_code

* update sn_code
  • Loading branch information
seujung authored and haohuw committed Jun 23, 2019
1 parent 374f3c5 commit b5c0867
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions example/gluon/sn_gan/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import mxnet as mx
from mxnet import nd
from mxnet import gluon
from mxnet import gluon, autograd
from mxnet.gluon import Block


Expand Down Expand Up @@ -68,7 +68,8 @@ def _spectral_norm(self):
if sigma == 0.:
sigma = EPSILON

self.params.setattr('u', _u)
with autograd.pause():
self.u.set_data(_u)

return w / sigma

Expand Down

0 comments on commit b5c0867

Please sign in to comment.