A package for finding optimal learning rate for pytorch models
Project description
Pytorch Learning Rate Finder
This package can be used to find optimal learning rate.
The package includes LearningRateFinder
class which implements the fit
, find_optimal_lr method
. The fit
method is used to find optimal learning rate within a range (optional)
Installation
To install with pip run the following command
pip install pytorch-lr-finder
Dependencies
This package requires the following to be installed:
- Python 3.6 or higher
- Pytorch
- Numpy
- Pandas
- Matplotlib
Instruction for usage
LearningRateFinder
takes instantiated pytorch model (nn.module
), criterion and optimizer (torch.optim
).
The fit
method requires a dataloader (torch.utils.data.DataLoader
), you can optionally include the number of steps, the starting and ending learning rate. The plot
function can be used to visualize the results in a plot. Please follow the example below for reference.
lrf = LearningRateFinder(model, criterion, optimizer)
lrf.fit(train_loader)
lrf.plot()
Example
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pytorch_lr_finder-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6dde0adb9607d4c3bbbe31f6b7d234308be2ef05e40a7c06905909a8adff3b7e |
|
MD5 | b9fbdf1f128ba716cc684df547266a27 |
|
BLAKE2b-256 | 7db0d0db115f563ad978c2c6a411e49c928d4b122083760cc1264dc6abbaee61 |