Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 1.04 KB

README.md

File metadata and controls

39 lines (30 loc) · 1.04 KB

torch-lr-scheduler Build Status codecov PyPI version

PyTorch Optimizer Lr Scheduler.

Installation

Need Python 3.6+.

pip install torch-lr-scheduler

Usage

import torch_lr_scheduler


lr_scheduler = torch_lr_scheduler.factory(config={
    'line_chain': [{
        # warm up to 0.8
        'mode': 'linear',
        'ratio': 0.01,
        'start': 0.2,
        'target': 0.8
    }, {
        # cosine to 0.0
        'mode': 'cosine',
        'ratio': 1.0,
        'target': 0.0
    }]
})

print(lr_scheduler)
#> LrScheduler (learning_rate_scale: 1.0) with LineChain (
#>     1.0%, linear from 0.2 to 0.8,
#>   100.0%, cosine from 0.8 to 0.0,
#> )