Skip to content

Commit

Permalink
ref: move lr_finder (#3434)
Browse files Browse the repository at this point in the history
* ref: move lr_finder

* ref: move lr_finder

* ref: move lr_finder

* ref: move lr_finder

* ref: move lr_finder

* ref: move lr_finder

* ref: move lr_finder
  • Loading branch information
williamFalcon committed Sep 10, 2020
1 parent 435e479 commit 5abf7d9
Show file tree
Hide file tree
Showing 5 changed files with 263 additions and 198 deletions.
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

0 comments on commit 5abf7d9

Please sign in to comment.