Caffe2 - Python API
A deep learning, cross platform ML framework
Public Member Functions | Static Public Attributes | List of all members
caffe2.python.core.GradientRegistry Class Reference
Inheritance diagram for caffe2.python.core.GradientRegistry:

Public Member Functions

def RegisterGradient (cls, op_type)
 
def GetGradientForOp (cls, op, g_output)
 
def GetBackwardPass (cls, operators, ys, ys_generate_gradient=False)
 

Static Public Attributes

dictionary gradient_registry_ = {}
 

Detailed Description

GradientRegistry holds the mapping from operators to their gradients.

Definition at line 1014 of file core.py.

Member Function Documentation

def caffe2.python.core.GradientRegistry.GetBackwardPass (   cls,
  operators,
  ys,
  ys_generate_gradient = False 
)
Gets the backward pass for the list of operators.

Args:
    operators: a list of operators constituting the forward pass.
    ys: a list or a dictionary specifying what blobs we want to compute
derivatives of. If the input is a list, we will automatically
generate their gradients with all-one values; if the input is a
dictionary, for any dictionary entries that are not None, we'll
take the corresponding blobs as their gradients; for all those
that are None, we will auto-fill them with 1.
Returns:
    gradient_ops: a list of gradient operators to run.
    all_input_to_grads: a map from input to their corresponding
gradients.

Definition at line 1092 of file core.py.

def caffe2.python.core.GradientRegistry.RegisterGradient (   cls,
  op_type 
)
A decorator for registering gradient mappings.

Definition at line 1019 of file core.py.


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