32579822389423c7f4120e222aa26652f8507735,onmt/utils/optimizers.py,Optimizer,set_parameters,#Optimizer#Any#,172
Before Change
self.params = []
self.sparse_params = []
for k, p in params:
if p.requires_grad:
if self.method != "sparseadam" or "embed" not in k:
self.params.append(p)
else:
self.sparse_params.append(p)
if self.method == "sgd":
self.optimizer = optim.SGD(self.params, lr=self.learning_rate)
elif self.method == "adagrad":
self.optimizer = optim.Adagrad(self.params, lr=self.learning_rate)
After Change
def set_parameters(self, model):
?
params = [p for p in model.parameters() if p.requires_grad]
if self.method == "sgd":
self.optimizer = optim.SGD(params, lr=self.learning_rate)
elif self.method == "adagrad":
self.optimizer = optim.Adagrad(
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
Instances
Project Name: OpenNMT/OpenNMT-py
Commit Name: 32579822389423c7f4120e222aa26652f8507735
Time: 2018-12-18
Author: guillaumekln@users.noreply.github.com
File Name: onmt/utils/optimizers.py
Class Name: Optimizer
Method Name: set_parameters
Project Name: silvandeleemput/memcnn
Commit Name: 375f42176d438788acac405e5982914ce04aa43f
Time: 2020-03-01
Author: silvandeleemput@gmail.com
File Name: memcnn/models/revop.py
Class Name: InvertibleModuleWrapper
Method Name: inverse
Project Name: silvandeleemput/memcnn
Commit Name: 375f42176d438788acac405e5982914ce04aa43f
Time: 2020-03-01
Author: silvandeleemput@gmail.com
File Name: memcnn/models/revop.py
Class Name: InvertibleModuleWrapper
Method Name: forward