441457bb25c582108b28c3b46baaecbd7bcac3e9,paysage/optimizers.py,GradientMemory,update_mean,#GradientMemory#Any#,23

Before Change


        if self.mean_gradient is None:
            self.mean_gradient = deepcopy(grad)
        else:
            for key in grad:
                // grad[key] is a list
                for i in range(len(grad[key])):
                    // grad[key][i] is a namedtuple
                    for j in range(len(grad[key][i])):
                        // grad[key][i][j] is a tensor
                        be.mix_inplace(self.mean_weight,
                        self.mean_gradient[key][i][j],
                        grad[key][i][j]
                        )

    def update_mean_square(self, grad):
        
        Update the running average of the squared model gradients.

After Change



        
        if self.mean_gradient is None:
            self.mean_gradient = hidden.grad_apply(identity, grad)
        else:
            hidden.grad_mapzip_(self.mixer_, self.mean_gradient, grad)

    def update_mean_square(self, grad):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: drckf/paysage
Commit Name: 441457bb25c582108b28c3b46baaecbd7bcac3e9
Time: 2017-04-05
Author: charleskennethfisher@gmail.com
File Name: paysage/optimizers.py
Class Name: GradientMemory
Method Name: update_mean


Project Name: drckf/paysage
Commit Name: a8b7bb2a628997761d8b072ed955af12f382f7e8
Time: 2017-04-05
Author: charleskennethfisher@gmail.com
File Name: paysage/optimizers.py
Class Name: StochasticGradientDescent
Method Name: update


Project Name: drckf/paysage
Commit Name: 64c9109d1423ee7288926a1d8743fe6cbd7a0022
Time: 2017-04-05
Author: charleskennethfisher@gmail.com
File Name: paysage/optimizers.py
Class Name: Momentum
Method Name: update