Caffe2 - Python API
A deep learning, cross platform ML framework
Functions | Variables
optim_baseline Namespace Reference

Functions

def weight_init (module)
 
def run (optimizer_name, iterations, sample_every)
 
def emit (optimizer_parameter_map)
 
def main ()
 

Variables

string HEADER
 
string FOOTER = "} // namespace expected_parameters"
 
string PARAMETERS = "inline std::vector<std::vector<torch::Tensor>> {}() {{"
 
dictionary OPTIMIZERS
 

Detailed Description

Script to generate baseline values from PyTorch optimization algorithms

Variable Documentation

string optim_baseline.HEADER
Initial value:
1 = """
2 #include <torch/types.h>
3 
4 #include <vector>
5 
6 namespace expected_parameters {
7 """

Definition at line 11 of file optim_baseline.py.

dictionary optim_baseline.OPTIMIZERS
Initial value:
1 = {
2  "Adam": lambda p: torch.optim.Adam(p, 1.0),
3  "Adam_with_weight_decay": lambda p: torch.optim.Adam(p, 1.0, weight_decay=1e-2),
4  "Adam_with_weight_decay_and_amsgrad": lambda p: torch.optim.Adam(p, 1.0, weight_decay=1e-6, amsgrad=True),
5  "Adagrad": lambda p: torch.optim.Adagrad(p, 1.0),
6  "Adagrad_with_weight_decay": lambda p: torch.optim.Adagrad(p, 1.0, weight_decay=1e-2),
7  "Adagrad_with_weight_decay_and_lr_decay": lambda p: torch.optim.Adagrad(p, 1.0, weight_decay=1e-6, lr_decay=1e-3),
8  "RMSprop": lambda p: torch.optim.RMSprop(p, 0.1),
9  "RMSprop_with_weight_decay": lambda p: torch.optim.RMSprop(p, 0.1, weight_decay=1e-2),
10  "RMSprop_with_weight_decay_and_centered": lambda p: torch.optim.RMSprop(p, 0.1, weight_decay=1e-6, centered=True),
11  "RMSprop_with_weight_decay_and_centered_and_momentum":
12  lambda p: torch.optim.RMSprop(p, 0.1, weight_decay=1e-6, centered=True, momentum=0.9),
13  "SGD": lambda p: torch.optim.SGD(p, 0.1),
14  "SGD_with_weight_decay": lambda p: torch.optim.SGD(p, 0.1, weight_decay=1e-2),
15  "SGD_with_weight_decay_and_momentum": lambda p: torch.optim.SGD(p, 0.1, momentum=0.9, weight_decay=1e-2),
16  "SGD_with_weight_decay_and_nesterov_momentum":
17  lambda p: torch.optim.SGD(p, 0.1, momentum=0.9, weight_decay=1e-6, nesterov=True),
18 }

Definition at line 23 of file optim_baseline.py.