You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/10/16 01:57:37 UTC
[GitHub] [incubator-mxnet] starimpact commented on issue #15102: the grad of
lars should be scaled in lbsgd
starimpact commented on issue #15102: the grad of lars should be scaled in lbsgd
URL: https://github.com/apache/incubator-mxnet/issues/15102#issuecomment-542476256
_l2norm is time consuming for a large parameter, so I suggest it should be:
```python
def _l2norm(self, v):
"inner product implementation"
#for big local parameter
v = v.reshape(-1)
if len(v) > 100000:
step = len(v)/100000+1
v = v[::step]
norm = multiply(v, v).asnumpy().sum()
#norm = (multiply(v, v).sum()).asnumpy()
norm = math.sqrt(norm)
return norm
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services