Caffe2 - Python API
A deep learning, cross platform ML framework
Public Member Functions | Public Attributes | List of all members
layers.layers.ModelLayer Class Reference
Inheritance diagram for layers.layers.ModelLayer:
layers.batch_distill_lr_loss.BatchDistillLRLoss layers.batch_lr_loss.BatchLRLoss layers.batch_mse_loss.BatchMSELoss layers.concat.Concat layers.dot_product.DotProduct layers.expand_dims.ExpandDims layers.fc.FC layers.fc_without_bias.FCWithoutBias layers.functional.Functional layers.sparse_lookup.SparseLookup layers.sparse_to_dense.SparseToDense layers.split.Split

Public Member Functions

def __init__ (self, model, prefix, input_record, predict_input_record_fields=None, tags=None, kwargs)
 
def get_type (self)
 
def predict_input_record (self)
 
def input_record (self)
 
def predict_output_schema (self)
 
def predict_output_schema (self, output_schema)
 
def output_schema (self)
 
def output_schema (self, output_schema)
 
def get_parameters (self)
 
def get_fp16_compatible_parameters (self)
 
def get_memory_usage (self)
 
def add_operators (self, net, init_net=None, context=InstantiationContext.TRAINING)
 
def add_ops (self, net)
 
def add_eval_ops (self, net)
 
def add_train_ops (self, net)
 
def add_calibration_ops (self, net)
 

Public Attributes

 name
 
 model
 
 kwargs
 
 request_only
 
 eval_output_schema
 
 tags
 
 params
 

Detailed Description

Definition at line 82 of file layers.py.

Constructor & Destructor Documentation

◆ __init__()

def layers.layers.ModelLayer.__init__ (   self,
  model,
  prefix,
  input_record,
  predict_input_record_fields = None,
  tags = None,
  kwargs 
)
Base class for model layers. Layer is an abstraction that allows to
provide model description in terms of meta-operators, where each of the
meta-operators can have different implementations for training,
evaluation and prediction, that are instantiated later. As an example
SampledSoftmax can do something related to sampling depending on
supervision during the training and just apply softmax if it's used for
prediction/evaluation.

All inputs/outputs from layers are represented as a record (instance of
schema bounded to blobs) and are accessible through input_record and
output_schema. If Layer needs to have only a subset of inputs/provides
subset of outputs during the inference - it should provide
predict_input_record and predict_output_schema correspondingly (those
records are expected to be a subset of input_record/output_schema).

Each layer is also have list of Tags associated with it, that depends on
current context and arguments. It's possible to use those tags during
the instantiation time.

Definition at line 85 of file layers.py.

Member Function Documentation

◆ get_fp16_compatible_parameters()

def layers.layers.ModelLayer.get_fp16_compatible_parameters (   self)
Return a subset of parameters which can be converted to fp16

Definition at line 175 of file layers.py.


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