Caffe2 - Python API
A deep learning, cross platform ML framework
List of all members
caffe2.python.optimizer_context.UseOptimizer Class Reference
Inheritance diagram for caffe2.python.optimizer_context.UseOptimizer:

Detailed Description

context class to allow setting the current context.
Example usage with brew:
    - with UseOptimizer(optim):
        brew.func
    - with UseOptimizer({'WEIGHT': weight_optim}):
        brew.func
    - with UseOptimizer({'DEFAULT': optim, 'BIAS': bias_optim,
                            'WEIGHT': weight_optim}):
        brew.func
    - with UseOptimizer(optim1):
        brew.func
        with UseOptimizer(optim2):
            brew.func

Example useage with layer:
    optimizers = {'optim1': optim1, 'optim2': optim2}
    with Optimizers(optimizers):
        optim = OptimizerContext.current().get_optimizer('optim1')
        layer(optim=optim)

Definition at line 31 of file optimizer_context.py.


The documentation for this class was generated from the following file: