|
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_init_params (self, init_net) |
|
def | create_param (self, param_name, shape, initializer, optimizer, ps_param=None, regularizer=None) |
|
def | get_next_blob_reference (self, name) |
|
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_ops_to_accumulate_pred (self, net) |
|
def | add_param_copy_operators (self, net) |
|
def | export_output_for_metrics (self) |
|
def | export_params_for_metrics (self) |
|
|
| name |
|
| model |
|
| kwargs |
|
| request_only |
|
| precomputation_request_only |
|
| precomputation_object_only |
|
| eval_output_schema |
|
| tags |
|
| params |
|
Definition at line 195 of file layers.py.
def caffe2.python.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 has a 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 198 of file layers.py.
def caffe2.python.layers.layers.ModelLayer.add_init_params |
( |
|
self, |
|
|
|
init_net |
|
) |
| |
Adds layer initialization operators to passed net.
Definition at line 302 of file layers.py.
def caffe2.python.layers.layers.ModelLayer.add_operators |
( |
|
self, |
|
|
|
net, |
|
|
|
init_net = None , |
|
|
|
context = InstantiationContext.TRAINING |
|
) |
| |
Adds layer trainig or initialization operators to the passed in net.
init_net can be None and can be called independently from add_init_params
Definition at line 354 of file layers.py.
def caffe2.python.layers.layers.ModelLayer.get_fp16_compatible_parameters |
( |
|
self | ) |
|
Return a subset of parameters which can be converted to fp16
Definition at line 295 of file layers.py.
The documentation for this class was generated from the following file: