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

Public Member Functions

def __init__ (self, name, input_feature_schema, trainer_extra_schema, keep_blobs=False)
 
def clear_output_schema (self)
 
def set_initialize_params (self, initialize_params)
 
def add_metric_field (self, name, value)
 
def add_ad_hoc_plot_blob (self, blob, dtype=None)
 
def add_global_constant (self, name, array=None, dtype=None, initializer=None)
 
def maybe_add_global_constant (self, name, args, kwargs)
 
def create_init_net (self, name)
 
def create_param (self, param_name, shape, initializer, optimizer=None, ps_param=None, regularizer=None)
 
def next_layer_name (self, prefix)
 
def add_layer (self, layer)
 
def get_parameter_blobs (self)
 
def add_post_grad_net_modifiers (self, modifier)
 
def add_final_net_modifiers (self, modifier)
 
def seed (self)
 
def sequence_seed (self)
 
def store_seed (self, seed, sequence_seed=True)
 
def apply_seed (self, net)
 
def default_optimizer (self)
 
def default_optimizer (self, optimizer)
 
def input_feature_schema (self)
 
def trainer_extra_schema (self)
 
def metrics_schema (self)
 
def output_schema (self)
 
def output_schema (self, schema)
 
def preproc_output_schema (self)
 
def preproc_output_schema (self, schema)
 
def prediction (self)
 
def add_prediction (self, prediction, weight=1.0)
 
def loss (self)
 
def loss (self, loss)
 
def has_loss (self)
 
def add_loss (self, loss, name='unnamed')
 
def add_output_schema (self, name, value)
 
def add_trainer_extra_schema (self, trainer_extra_schema)
 
def __getattr__ (self, layer)
 
def layers (self)
 
def apply_regularizers_on_loss (self, train_net, train_init_net, blob_to_device=None)
 
def apply_regularizers_after_optimizer (self, train_net, train_init_net, grad_map, blob_to_device=None)
 
def apply_post_grad_net_modifiers (self, trainer_net, trainer_init_net, grad_map, blob_to_device=None, modify_output_record=False)
 
def apply_final_net_modifiers (self, trainer_net, trainer_init_net, grad_map, blob_to_device=None, modify_output_record=False)
 
def apply_optimizers (self, train_net, train_init_net, grad_map, blob_to_device=None)
 
def NoOptim (self, args, kwargs)
 
def breakdown_map (self)
 
def breakdown_map (self, breakdown_map)
 
- Public Member Functions inherited from caffe2.python.model_helper.ModelHelper
def __init__ (self, name=None, init_params=True, allow_not_known_ops=True, skip_sparse_optim=False, param_model=None, arg_scope=None)
 
def arg_scope (self)
 
def get_name (self)
 
def create_param (self, param_name, shape, initializer, tags=None)
 
def get_param_info (self, param)
 
def add_param_DEPRECATED (self, param, key=None, shape=None, length=None)
 
def AddParameter (self, param, tags=None)
 
def GetParams (self, namescope=None, top_scope=False)
 
def Proto (self)
 
def InitProto (self)
 
def RunAllOnGPU (self, args, kwargs)
 
def CreateDB (self, blob_out, db, db_type, kwargs)
 
def AddGradientOperators (self, args, kwargs)
 
def get_param_to_grad (self, params)
 
def GetOptimizationParamInfo (self, params=None)
 
def Validate (self)
 
def GetComputedParams (self, namescope=None)
 
def GetAllParams (self, namescope=None)
 
def TensorProtosDBInput (self, unused_blob_in, blob_out, batch_size, db, db_type, kwargs)
 
def GetDevices (self)
 
def __getattr__ (self, op_type)
 
def __dir__ (self)
 
def GetCompleteNet (self)
 
def ConstructInitTrainNetfromNet (self, net)
 

Public Attributes

 param_to_optim
 
 param_to_reg
 
 param_init_net
 
 ad_hoc_diagnose_blobs_and_operations
 
 ad_hoc_plot_blobs
 
 global_constants
 
 global_constant_initializers
 
- Public Attributes inherited from caffe2.python.model_helper.ModelHelper
 name
 
 net
 
 param_init_net
 
 param_to_grad
 
 params
 
 gradient_ops_added
 
 init_params
 
 allow_not_known_ops
 
 skip_sparse_optim
 
 weights
 
 biases
 
 grad_map
 

Detailed Description

Model helper for building models on top of layers abstractions.

Each layer is the abstraction that is higher level than Operator. Layer
is responsible for ownership of it's own parameters and can easily be
instantiated in multiple nets possible with different sets of ops.
As an example: one can easily instantiate predict and train nets from
the same set of layers, where predict net will have subset of the
operators from train net.

Definition at line 30 of file layer_model_helper.py.

Constructor & Destructor Documentation

def caffe2.python.layer_model_helper.LayerModelHelper.__init__ (   self,
  name,
  input_feature_schema,
  trainer_extra_schema,
  keep_blobs = False 
)
TODO(amalevich): more documnetation on input args

Definition at line 43 of file layer_model_helper.py.

Member Function Documentation

def caffe2.python.layer_model_helper.LayerModelHelper.metrics_schema (   self)
Returns the schema that represents model output that should be used for
metric reporting.

During the training/evaluation this schema will be appended to the
schema that represents model output.

Definition at line 376 of file layer_model_helper.py.


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