9334d336f027e8b90d5751458c7794f8a0167559,thinc/shims/mxnet.py,MXNetShim,finish_update,#MXNetShim#Any#,59
Before Change
if i._grad is not None
]
mxnet.gluon.utils.clip_global_norm(grads, optimizer.grad_clip)
if self._trainer:
self._trainer.step(1)
for param in self._model.collect_params().values():
param.zero_grad()
self._update_mxnet_averages(optimizer)
After Change
def finish_update(self, optimizer: Optimizer):
for value in self._model.collect_params().values():
grad = cast(FloatsXd, mxnet2xp(value.grad()))
param = cast(FloatsXd, mxnet2xp(value.data()))
param, _ = optimizer((value.name, value.name), param, grad)
value.set_data(xp2mxnet(param))
def copy(self, ctx: "mx.context.Context" = None):
if ctx is None:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: explosion/thinc
Commit Name: 9334d336f027e8b90d5751458c7794f8a0167559
Time: 2020-05-11
Author: justin@dujardinconsulting.com
File Name: thinc/shims/mxnet.py
Class Name: MXNetShim
Method Name: finish_update
Project Name: explosion/thinc
Commit Name: 9334d336f027e8b90d5751458c7794f8a0167559
Time: 2020-05-11
Author: justin@dujardinconsulting.com
File Name: thinc/shims/mxnet.py
Class Name: MXNetShim
Method Name: finish_update
Project Name: explosion/thinc
Commit Name: f2754e0656d8cebe1f785f6af100e4ade241a7f8
Time: 2020-01-14
Author: honnibal+gh@gmail.com
File Name: thinc/model.py
Class Name: Model
Method Name: finish_update
Project Name: masa-su/pixyz
Commit Name: 161ae41bebc73c146627169f761e3c4ddf83e5d4
Time: 2020-10-26
Author: kaneko@weblab.t.u-tokyo.ac.jp
File Name: pixyz/losses/losses.py
Class Name: Expectation
Method Name: __init__