eric-haibin-lin commented on a change in pull request #16885: Multi Precision
Lamb Update operator
URL: https://github.com/apache/incubator-mxnet/pull/16885#discussion_r352768528
##########
File path: python/mxnet/optimizer/optimizer.py
##########
@@ -1262,34 +1263,73 @@ def __init__(self, learning_rate=0.001, beta1=0.9,
beta2=0.999, epsilon=1e-6,
def create_state(self, index, weight):
stype = weight.stype
- dtype = weight.dtype
- return (zeros(weight.shape, weight.context, dtype=dtype, stype=stype),
- zeros(weight.shape, weight.context, dtype=dtype, stype=stype))
+ return (zeros(weight.shape, weight.context, dtype=numpy.float32,
stype=stype),
+ zeros(weight.shape, weight.context, dtype=numpy.float32,
stype=stype))
+
+ def _update_impl(self, indices, weights, grads, states,
multi_precision=False):
+ aggregate = True
Review comment:
Not sure why you added the logic for aggregation in the code - that's used
for multi-tensor updaters, which is not included in this PR. In your optimizer
the indices will always be integer, right? I suggest we remove these unrelated
logic in this PR
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services