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

ref: move lr_finder #3434

Merged
merged 7 commits into from
Sep 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions docs/source/lr_finder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ of this would look like
trainer = Trainer()

# Run learning rate finder
lr_finder = trainer.lr_find(model)
lr_finder = trainer.tuner.lr_find(model)

# Results can be found in
lr_finder.results
Expand All @@ -110,7 +110,5 @@ This is the point returned py ``lr_finder.suggestion()``.

The parameters of the algorithm can be seen below.

.. autoclass:: pytorch_lightning.trainer.lr_finder.TrainerLRFinderMixin
:members: lr_find
.. autofunction:: pytorch_lightning.tuner.lr_finder.lr_find
:noindex:
:exclude-members: _run_lr_finder_internally, save_checkpoint, restore
4 changes: 1 addition & 3 deletions pytorch_lightning/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
from pytorch_lightning.trainer.distrib_data_parallel import TrainerDDPMixin
from pytorch_lightning.utilities import device_parser
from pytorch_lightning.trainer.logging import TrainerLoggingMixin
from pytorch_lightning.trainer.lr_finder import TrainerLRFinderMixin
from pytorch_lightning.trainer.model_hooks import TrainerModelHooksMixin
from pytorch_lightning.trainer.optimizers import TrainerOptimizersMixin
from pytorch_lightning.trainer.states import TrainerState, trainer_state
Expand Down Expand Up @@ -97,7 +96,6 @@ class Trainer(
TrainerTrainingTricksMixin,
TrainerDataLoadingMixin,
TrainerCallbackConfigMixin,
TrainerLRFinderMixin,
TrainerDeprecatedAPITillVer0_10,
):
def __init__(
Expand Down Expand Up @@ -454,7 +452,7 @@ def tune(

# Run learning rate finder:
if self.auto_lr_find:
self._run_lr_finder_internally(model)
self.tuner.internal_find_lr(self, model)
model.logger = self.logger # reset logger binding

# -----------------------------
Expand Down
Loading