Skip to content
New issue

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

Poly learning rate scheduler not doing anything #263

Open
connorlee77 opened this issue Oct 16, 2022 · 1 comment
Open

Poly learning rate scheduler not doing anything #263

connorlee77 opened this issue Oct 16, 2022 · 1 comment

Comments

@connorlee77
Copy link

The poly learning rate doesn't work as intended. The current implementation is as follows:

def get_lr(self):
        if self.last_epoch % self.decay_iter or self.last_epoch % self.max_iter:
            return [base_lr for base_lr in self.base_lrs]
        else:
            factor = (1 - self.last_epoch / float(self.max_iter)) ** self.gamma
            return [base_lr * factor for base_lr in self.base_lrs]

Notice that the else condition will never get hit since self.last_epoch % self.max_iter will almost always return a non-zero number.

@hjhjb
Copy link

hjhjb commented Oct 16, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants