6b03d5ad8b61cf6638a93df5307ed4bfa770c2e3,paysage/optimizers.py,Momentum,update,#Momentum#Any#Any#Any#Any#,63
Before Change
self.delta = {key: numpy.zeros_like(model.params[key]) for key in model.params}
def update(self, model, v_data, v_model, epoch):
lr = self.update_lr(epoch) * 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:
self.delta[key] = self.grad[key] + self.momentum * self.delta[key]
model.params[key] -= lr * self.delta[key]
model.enforce_constraints()
After Change
self.delta = {key: numpy.zeros_like(model.params[key]) for key in model.params}
def update(self, model, v_data, v_model, epoch):
self.scheduler.increment(epoch)
lr = self.scheduler.get_lr() * self.stepsize
self.grad = gradient(model, v_data, v_model)
if model.penalty:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: drckf/paysage
Commit Name: 6b03d5ad8b61cf6638a93df5307ed4bfa770c2e3
Time: 2017-01-31
Author: charlesfisher@Charless-MacBook-Pro.local
File Name: paysage/optimizers.py
Class Name: Momentum
Method Name: update
Project Name: drckf/paysage
Commit Name: 6b03d5ad8b61cf6638a93df5307ed4bfa770c2e3
Time: 2017-01-31
Author: charlesfisher@Charless-MacBook-Pro.local
File Name: paysage/optimizers.py
Class Name: RMSProp
Method Name: update
Project Name: drckf/paysage
Commit Name: 6b03d5ad8b61cf6638a93df5307ed4bfa770c2e3
Time: 2017-01-31
Author: charlesfisher@Charless-MacBook-Pro.local
File Name: paysage/optimizers.py
Class Name: StochasticGradientDescent
Method Name: update