defa1283c44653c29b81403f9d9f19fb3df0a27d,keras/optimizers.py,Adam,get_updates,#Adam#Any#Any#Any#,321

Before Change


        t = self.iterations + 1
        lr_t = self.lr * K.sqrt(1. - K.pow(self.beta_2, t)) / (1. - K.pow(self.beta_1, t))

        ms = [K.variable(np.zeros(K.get_value(p).shape)) for p in params]
        vs = [K.variable(np.zeros(K.get_value(p).shape)) for p in params]
        self.weights = ms + vs

        for p, g, m, v in zip(params, grads, ms, vs):
            m_t = (self.beta_1 * m) + (1. - self.beta_1) * g
            v_t = (self.beta_2 * v) + (1. - self.beta_2) * K.square(g)

After Change


        t = self.iterations + 1
        lr_t = self.lr * K.sqrt(1. - K.pow(self.beta_2, t)) / (1. - K.pow(self.beta_1, t))

        shapes = [x.shape for x in K.batch_get_value(params)]
        ms = [K.zeros(shape) for shape in shapes]
        vs = [K.zeros(shape) for shape in shapes]
        self.weights = [self.iterations] + ms + vs

        for p, g, m, v in zip(params, grads, ms, vs):
            m_t = (self.beta_1 * m) + (1. - self.beta_1) * g
            v_t = (self.beta_2 * v) + (1. - self.beta_2) * K.square(g)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 19

Instances


Project Name: keras-team/keras
Commit Name: defa1283c44653c29b81403f9d9f19fb3df0a27d
Time: 2016-07-21
Author: francois.chollet@gmail.com
File Name: keras/optimizers.py
Class Name: Adam
Method Name: get_updates


Project Name: keras-team/keras
Commit Name: defa1283c44653c29b81403f9d9f19fb3df0a27d
Time: 2016-07-21
Author: francois.chollet@gmail.com
File Name: keras/optimizers.py
Class Name: Adam
Method Name: get_updates


Project Name: keras-team/keras
Commit Name: defa1283c44653c29b81403f9d9f19fb3df0a27d
Time: 2016-07-21
Author: francois.chollet@gmail.com
File Name: keras/optimizers.py
Class Name: Nadam
Method Name: get_updates


Project Name: keras-team/keras
Commit Name: defa1283c44653c29b81403f9d9f19fb3df0a27d
Time: 2016-07-21
Author: francois.chollet@gmail.com
File Name: keras/optimizers.py
Class Name: Adamax
Method Name: get_updates