d5fdcbf3bae3ea85cb89394147db4b1da0105fb4,python/mxnet/gluon/trainer.py,Trainer,__init__,#Trainer#Any#Any#Any#Any#Any#Any#,78
Before Change
for key in sorted(list(params.keys())):
param_list.append(params[key])
params = param_list
if not isinstance(params, (list, tuple)):
raise ValueError(
"First argument must be a list or dict of Parameters, " \
"got %s."%(type(params)))
self._params = []
// parameters to initialize on the kvstore
self._contains_sparse_weight = False
self._contains_sparse_grad = False
After Change
py_version = sys.version_info
assert isinstance(params, (dict, OrderedDict)), \
"invalid params type: {}. Expected dict type".format(type(params))
names = list(params.keys())
param_list = []
// only python 3.5 requires sorting
if py_version[0] == 3 and py_version[1] == 5:
names = sorted(names)
for name in names:
p = params[name]
if not isinstance(p, Parameter):
raise ValueError(
"First argument must be a dict of Parameters, " \
"got list of %s."%(type(p)))
param_list.append(p)
// Shared parameters have same uuid; only need to store one of the shared versions
if p._uuid in self._param2name:
continue
self._param2name[p._uuid] = name
params = param_list
self._params = []
// parameters to initialize on the kvstore
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances
Project Name: apache/incubator-mxnet
Commit Name: d5fdcbf3bae3ea85cb89394147db4b1da0105fb4
Time: 2020-08-07
Author: linhaibin.eric@gmail.com
File Name: python/mxnet/gluon/trainer.py
Class Name: Trainer
Method Name: __init__
Project Name: pyannote/pyannote-audio
Commit Name: dc357b0e9d2bc40633f738997e8b7d17221c28fd
Time: 2018-06-29
Author: bredin@limsi.fr
File Name: pyannote/audio/util.py
Class Name:
Method Name: from_numpy
Project Name: Scitator/catalyst
Commit Name: 1a73a1367fedfa8368b6c42103e60e1b370bc14a
Time: 2019-04-19
Author: scitator@gmail.com
File Name: catalyst/contrib/criterion/focal_loss.py
Class Name: FocalLoss
Method Name: forward