GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Packages
  • Classes
  • Files
  • C++ API
  • GitHub
  • Class Index
  • Class Hierarchy
  • Class Members
  • optim
  • LambdaLR
  • lr_scheduler.py

This view

  • Original page
  • New address

GeezerVison is showing caffe2.ai — Caffe2 - Python API: torch.optim.lr_scheduler.LambdaLR Class Reference

Logo
Caffe2 - Python API
A deep learning, cross platform ML framework
  • Packages
  • Classes
  • Files
  • C++ API
  • Python API
  • GitHub
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • torch
  • optim
  • lr_scheduler
  • LambdaLR
Public Member Functions | Public Attributes | List of all members
torch.optim.lr_scheduler.LambdaLR Class Reference
Inheritance diagram for torch.optim.lr_scheduler.LambdaLR:

Public Member Functions

def __init__ (self, optimizer, lr_lambda, last_epoch=-1)
 
def state_dict (self)
 
def load_state_dict (self, state_dict)
 
def get_lr (self)
 
- Public Member Functions inherited from torch.optim.lr_scheduler._LRScheduler
def __init__ (self, optimizer, last_epoch=-1)
 
def state_dict (self)
 
def load_state_dict (self, state_dict)
 
def get_lr (self)
 
def step (self, epoch=None)
 

Public Attributes

 optimizer
 
 lr_lambdas
 
 last_epoch
 
- Public Attributes inherited from torch.optim.lr_scheduler._LRScheduler
 optimizer
 
 base_lrs
 
 last_epoch
 

Detailed Description

Sets the learning rate of each parameter group to the initial lr
times a given function. When last_epoch=-1, sets initial lr as lr.

Args:
    optimizer (Optimizer): Wrapped optimizer.
    lr_lambda (function or list): A function which computes a multiplicative
        factor given an integer parameter epoch, or a list of such
        functions, one for each group in optimizer.param_groups.
    last_epoch (int): The index of last epoch. Default: -1.

Example:
    >>> # Assuming optimizer has two groups.
    >>> lambda1 = lambda epoch: epoch // 30
    >>> lambda2 = lambda epoch: 0.95 ** epoch
    >>> scheduler = LambdaLR(optimizer, lr_lambda=[lambda1, lambda2])
    >>> for epoch in range(100):
    >>>     scheduler.step()
    >>>     train(...)
    >>>     validate(...)

Definition at line 56 of file lr_scheduler.py.

Member Function Documentation

def torch.optim.lr_scheduler.LambdaLR.load_state_dict (   self,
  state_dict 
)
Loads the schedulers state.

Arguments:
    state_dict (dict): scheduler state. Should be an object returned
from a call to :meth:`state_dict`.

Definition at line 107 of file lr_scheduler.py.

def torch.optim.lr_scheduler.LambdaLR.state_dict (   self)
Returns the state of the scheduler as a :class:`dict`.

It contains an entry for every variable in self.__dict__ which
is not the optimizer.
The learning rate lambda functions will only be saved if they are callable objects
and not if they are functions or lambdas.

Definition at line 90 of file lr_scheduler.py.


The documentation for this class was generated from the following file:
  • torch/optim/lr_scheduler.py

Generated on Thu Mar 21 2019 13:06:40 for Caffe2 - Python API by   doxygen 1.8.11

Facebook Open Source

Open Source Projects GitHub Twitter
Contribute to this project on GitHub
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.