We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NoamLR
pytorch-saltnet/utils/lr_scheduler.py
Lines 36 to 39 in a3e63b3
The custom NoamLR results in same LR in the first two steps, like:
warmup_steps = 10 lr = 0.01
There are two ways to fix this:
last_epoch = self.last_epoch + 1
def get_lr(self): last_epoch = self.last_epoch + 1 scale = self.warmup_steps ** 0.5 * min(last_epoch ** (-0.5), last_epoch * self.warmup_steps ** (-1.5)) return [base_lr * scale for base_lr in self.base_lrs]
LambdaLR
noam_scale = lambda epoch: (warmup_steps ** 0.5) * min((epoch + 1) ** -0.5, (epoch + 1) * (warmup_steps ** -1.5)) scheduler = torch.optim.lr_scheduler.LambdaLR(optimizer, lr_lambda=noam_scale)
Of course, the above two approaches are equivalent.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
pytorch-saltnet/utils/lr_scheduler.py
Lines 36 to 39 in a3e63b3
The custom
NoamLR
results in same LR in the first two steps, like:There are two ways to fix this:
last_epoch = self.last_epoch + 1
, like ESPnetLambdaLR
directlyOf course, the above two approaches are equivalent.
The text was updated successfully, but these errors were encountered: