f9f4587661731a334408d94a6bb79593a088c444,transformer/Optim.py,ScheduledOptim,_get_lr_scale,#ScheduledOptim#,22

Before Change


        self._optimizer.zero_grad()

    def _get_lr_scale(self):
        return np.min([
            np.power(self.n_current_steps, -0.5),
            np.power(self.n_warmup_steps, -1.5) * self.n_current_steps])

    def _update_learning_rate(self):
        """ Learning rate scheduling per step """

After Change



    def _get_lr_scale(self):
        n_steps, n_warmup_steps = self.n_steps, self.n_warmup_steps
        return min(n_steps ** (-0.5), n_steps * n_warmup_steps ** (-1.5))


    def _update_learning_rate(self):
        """ Learning rate scheduling per step """
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: jadore801120/attention-is-all-you-need-pytorch
Commit Name: f9f4587661731a334408d94a6bb79593a088c444
Time: 2019-11-28
Author: jadore801120@gmail.com
File Name: transformer/Optim.py
Class Name: ScheduledOptim
Method Name: _get_lr_scale


Project Name: commonsense/conceptnet5
Commit Name: 938e9716faa50db5695d937cae0b30d2cdbfd07c
Time: 2017-09-11
Author: joanna.teresa.duda@gmail.com
File Name: conceptnet5/vectors/transforms.py
Class Name:
Method Name: l2_normalize_rows


Project Name: MorvanZhou/Reinforcement-learning-with-tensorflow
Commit Name: 5e76b6981d0b48def00d4fa97caec24accf402fd
Time: 2017-08-16
Author: morvanzhou@gmail.com
File Name: contents/5.2_Prioritized_Replay_DQN/RL_brain.py
Class Name: Memory
Method Name: sample