Caffe2 - Python API
A deep learning, cross platform ML framework
Public Member Functions | Public Attributes | List of all members
caffe2.python.layers.arc_cosine_feature_map.ArcCosineFeatureMap Class Reference
Inheritance diagram for caffe2.python.layers.arc_cosine_feature_map.ArcCosineFeatureMap:
caffe2.python.layers.layers.ModelLayer caffe2.python.layers.semi_random_features.SemiRandomFeatures

Public Member Functions

def __init__ (self, model, input_record, output_dims, s=1, scale=1.0, weight_init=None, bias_init=None, weight_optim=None, bias_optim=None, set_weight_as_global_constant=False, initialize_output_schema=True, name='arc_cosine_feature_map', kwargs)
 
def add_ops (self, net)
 
- Public Member Functions inherited from caffe2.python.layers.layers.ModelLayer
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)
 

Public Attributes

 params
 
 model
 
 set_weight_as_global_constant
 
 input_dims
 
 output_schema
 
 output_dims
 
 s
 
 stddev
 
 random_w
 
 random_b
 
- Public Attributes inherited from caffe2.python.layers.layers.ModelLayer
 name
 
 model
 
 kwargs
 
 request_only
 
 precomputation_request_only
 
 precomputation_object_only
 
 eval_output_schema
 
 tags
 
 params
 

Detailed Description

A general version of the arc-cosine kernel feature map (s = 1 restores
the original arc-cosine kernel feature map).

Applies H(x) * x^s, where H is the Heaviside step function and x is the
input after applying FC (such that x = w * x_orig + b).

For more information, see the original paper:
    http://cseweb.ucsd.edu/~saul/papers/nips09_kernel.pdf

Inputs :
    output_dims -- dimensions of the output vector
    s -- degree to raise transformed features
    scale -- amount to scale the standard deviation
    weight_init -- initialization distribution for weight parameter
    bias_init -- initialization distribution for bias pararmeter
    weight_optim -- optimizer for weight params; None for random features
    bias_optim -- optimizer for bias param; None for random features
    set_weight_as_global_constant -- if True, initialized random parameters
                                     will be constant across all distributed
                                     instances of the layer
    initialize_output_schema -- if True, initialize output schema as Scalar
                                from Arc Cosine; else output schema is None

Definition at line 11 of file arc_cosine_feature_map.py.


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