af46ab0d4dc981b899fe6c82c1712e95f251a118,keras/optimizers.py,SGD,get_updates,#SGD#Any#Any#Any#Any#,38

Before Change


        self.iterations = shared_scalar(0)

    def get_updates(self, params, regularizers, constraints, cost):
        grads, params = self.get_gradients(cost, params, regularizers, constraints)
        lr = self.lr * (1.0 / (1.0 + self.decay * self.iterations))
        updates = [(self.iterations, self.iterations+1.)]

        for p, g in zip(params, grads):
            m = shared_zeros(p.get_value().shape) // momentum
            v = self.momentum * m - lr * g // velocity
            updates.append((m, v)) 

            if self.nesterov:
                new_p = p + self.momentum * v - lr * g
            else:
                new_p = p + v

            updates.append((p, new_p))
        return updates


class RMSprop(Optimizer):

After Change


            else:
                new_p = p + v

            self.update_params(p, new_p, updates, c)
        return updates


class RMSprop(Optimizer):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 5

Instances


Project Name: keras-team/keras
Commit Name: af46ab0d4dc981b899fe6c82c1712e95f251a118
Time: 2015-04-27
Author: michael.d.oliver@gmail.com
File Name: keras/optimizers.py
Class Name: SGD
Method Name: get_updates


Project Name: keras-team/keras
Commit Name: af46ab0d4dc981b899fe6c82c1712e95f251a118
Time: 2015-04-27
Author: michael.d.oliver@gmail.com
File Name: keras/optimizers.py
Class Name: RMSprop
Method Name: get_updates


Project Name: keras-team/keras
Commit Name: af46ab0d4dc981b899fe6c82c1712e95f251a118
Time: 2015-04-27
Author: michael.d.oliver@gmail.com
File Name: keras/optimizers.py
Class Name: Adadelta
Method Name: get_updates


Project Name: keras-team/keras
Commit Name: af46ab0d4dc981b899fe6c82c1712e95f251a118
Time: 2015-04-27
Author: michael.d.oliver@gmail.com
File Name: keras/optimizers.py
Class Name: Adagrad
Method Name: get_updates


Project Name: keras-team/keras
Commit Name: af46ab0d4dc981b899fe6c82c1712e95f251a118
Time: 2015-04-27
Author: michael.d.oliver@gmail.com
File Name: keras/optimizers.py
Class Name: Adam
Method Name: get_updates