2d8739dda9859b91bf2b7da5402d242555c48d7d,keras/optimizers.py,Adagrad,get_updates,#Adagrad#Any#Any#,283

Before Change


        shapes = [K.get_variable_shape(p) for p in params]
        accumulators = [K.zeros(shape) for shape in shapes]
        self.weights = accumulators
        self.updates = []

        lr = self.lr
        if self.initial_decay > 0:
            lr *= (1. / (1. + self.decay * self.iterations))
            self.updates.append(K.update_add(self.iterations, 1))

        for p, g, a in zip(params, grads, accumulators):
            new_a = a + K.square(g)  // update accumulator
            self.updates.append(K.update(a, new_a))

After Change


        shapes = [K.int_shape(p) for p in params]
        accumulators = [K.zeros(shape) for shape in shapes]
        self.weights = accumulators
        self.updates = [K.update_add(self.iterations, 1)]

        lr = self.lr
        if self.initial_decay > 0:
            lr *= (1. / (1. + self.decay * K.cast(self.iterations,
                                                  K.dtype(self.decay))))

        for p, g, a in zip(params, grads, accumulators):
            new_a = a + K.square(g)  // update accumulator
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 14

Instances


Project Name: keras-team/keras
Commit Name: 2d8739dda9859b91bf2b7da5402d242555c48d7d
Time: 2017-08-24
Author: francois.chollet@gmail.com
File Name: keras/optimizers.py
Class Name: Adagrad
Method Name: get_updates


Project Name: keras-team/keras
Commit Name: 2d8739dda9859b91bf2b7da5402d242555c48d7d
Time: 2017-08-24
Author: francois.chollet@gmail.com
File Name: keras/optimizers.py
Class Name: RMSprop
Method Name: get_updates


Project Name: keras-team/keras
Commit Name: 2d8739dda9859b91bf2b7da5402d242555c48d7d
Time: 2017-08-24
Author: francois.chollet@gmail.com
File Name: keras/optimizers.py
Class Name: Adadelta
Method Name: get_updates


Project Name: keras-team/keras
Commit Name: 2d8739dda9859b91bf2b7da5402d242555c48d7d
Time: 2017-08-24
Author: francois.chollet@gmail.com
File Name: keras/optimizers.py
Class Name: SGD
Method Name: get_updates