Skip to content
Discussion options

You must be logged in to vote

What you probably want to do, is to have an learning_rate attribute that you can change after inspecting the plot:
So your model should look something like this:

class MyModel(pl.LightningModule):
    def __init__(self, ...)
        self.learning_rate = 1e-2

    def configure_optimizers(self):
        return torch.optim.Adam(self.parameters(), lr=self.learning_rate)

then you should be able to do:

model = MyModel(...)
trainer = Trainer(...)
lrfinder = trainer.tuner.lr_finder(...)
lffinder.plot() # find the learning rate you want
model.learning_rate = 1234 # set what you want

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Haydnspass
Comment options

@SkafteNicki
Comment options

Answer selected by Haydnspass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment