d4f070d597c4f061e07e2706838b1e89193cd356,paysage/optimizers.py,StochasticGradientDescent,update,#StochasticGradientDescent#Any#Any#Any#Any#,73
Before Change
lr = self.scheduler.get_lr() * self.stepsize
self.grad = gradient(model, v_data, v_model)
if model.penalty:
for key in model.penalty:
self.grad[key] += model.penalty[key].grad(model.params[key])
for key in self.grad:
model.params[key] -= lr * self.grad[key]
model.enforce_constraints()
After Change
self.delta = model.gradient(v_data, v_model)
for l in self.delta["layers"]:
be.multiply_dict_inplace(l, lr)
for l in self.delta["weights"]:
be.multiply_dict_inplace(l, lr)
model.parameter_update(self.delta)
class Momentum(Optimizer):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 22
Instances
Project Name: drckf/paysage
Commit Name: d4f070d597c4f061e07e2706838b1e89193cd356
Time: 2017-03-17
Author: charleskennethfisher@gmail.com
File Name: paysage/optimizers.py
Class Name: StochasticGradientDescent
Method Name: update
Project Name: drckf/paysage
Commit Name: d4f070d597c4f061e07e2706838b1e89193cd356
Time: 2017-03-17
Author: charleskennethfisher@gmail.com
File Name: paysage/optimizers.py
Class Name: Momentum
Method Name: update
Project Name: drckf/paysage
Commit Name: 2921cade4187f926f89b35a4f56a9cb54fa2e2f3
Time: 2017-03-17
Author: charleskennethfisher@gmail.com
File Name: paysage/optimizers.py
Class Name: RMSProp
Method Name: update
Project Name: drckf/paysage
Commit Name: d4f070d597c4f061e07e2706838b1e89193cd356
Time: 2017-03-17
Author: charleskennethfisher@gmail.com
File Name: paysage/optimizers.py
Class Name: StochasticGradientDescent
Method Name: update