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)

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

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.

Source Distribution

pytorch_lr_finder-0.0.3.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytorch_lr_finder-0.0.3-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file pytorch_lr_finder-0.0.3.tar.gz.

File metadata

  • Download URL: pytorch_lr_finder-0.0.3.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.6

File hashes

Hashes for pytorch_lr_finder-0.0.3.tar.gz
Algorithm Hash digest
SHA256 f4cbaece1791d98a9fca7492a8b638703fae373abe82aeca7233974efef71e3e
MD5 f703dfb0c000554f431d61b4b4bdf37e
BLAKE2b-256 650dba913895cbf07a8567fdff6945eb11ff2def42afd6e3dac47b829a59a9ef

See more details on using hashes here.

File details

Details for the file pytorch_lr_finder-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pytorch_lr_finder-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.6

File hashes

Hashes for pytorch_lr_finder-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f7a33041dac862d8a91cf83ce8a152c2fa5a35d43d4310da5fea362feb1c58ee
MD5 0f60d0fe79b394a4a910a8356d12d41a
BLAKE2b-256 168bf3bbae6364bf78a2d31026d5f9cc80ef05d9fe3c8420067f2ea6da550444

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page