Skip to main content

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)


To install with pip run the following command

pip install pytorch-lr-finder


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 (, 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)


plot example

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pytorch-lr-finder, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size pytorch_lr_finder-0.0.3-py3-none-any.whl (8.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pytorch_lr_finder-0.0.3.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page