clDNN
cldnn::activation Struct Reference

Activation using rectified linear unit or parameterized rectified linear unit. More...

#include <activation.hpp>

Inheritance diagram for cldnn::activation:
Collaboration diagram for cldnn::activation:

Public Types

typedef cldnn_activation_desc dto
 

Public Member Functions

 activation (const primitive_id &id, const primitive_id &input, cldnn_activation_func activation_func, cldnn_activation_additional_params additional_params={ 0.f, 0.f }, const padding &output_padding=padding())
 Constructs Relu primitive. More...
 
 activation (const primitive_id &id, const primitive_id &input, const primitive_id &additional_params_input, cldnn_activation_func activation_func, const padding &output_padding=padding())
 Constructs activation with input per feature. More...
 
 activation (const dto *dto)
 Constructs a copy from basic C API cldnn_activation_desc.
 
- Public Member Functions inherited from cldnn::primitive_base< activation, cldnn_activation_desc >
const cldnn_primitive_descget_dto () const override
 Returns pointer to a C API primitive descriptor casted to cldnn_primitive_desc.
 
- Public Member Functions inherited from cldnn::primitive
 primitive (const primitive_type_id &type, const primitive_id &id, const std::vector< primitive_id > &input, const padding &output_padding=padding())
 
 primitive (const cldnn_primitive_desc *dto)
 Constructs a copy from basic C API cldnn_primitive_desc.
 
std::vector< std::reference_wrapper< primitive_id > > dependecies ()
 Returns references to all primitive ids on which this primitive depends - inputs, weights, biases, etc.
 
std::vector< primitive_iddependecies () const
 Returns copy of all primitive ids on which this primitive depends - inputs, weights, biases, etc.
 
 operator primitive_id () const
 Implicit conversion to primiitive id.
 

Static Public Member Functions

static primitive_type_id type_id ()
 

Public Attributes

cldnn_activation_func activation_func
 activation function.
 
cldnn_activation_additional_params additional_params
 activation additional params.
 
primitive_id additional_params_input
 PRelu activation slope input primitive id. Input x dimension should be equal to input feature size (one slope per channel). All other dimensions should be 1.
 
- Public Attributes inherited from cldnn::primitive
const primitive_type_id type
 Primitive's type id.
 
const primitive_id id
 Primitive's id.
 
fixed_size_vector_ref input
 List of ids of input primitives.
 
padding output_padding
 Requested output padding.
 

Protected Member Functions

std::vector< std::reference_wrapper< const primitive_id > > get_dependencies () const override
 
void update_dto (dto &dto) const override
 
- Protected Member Functions inherited from cldnn::primitive_base< activation, cldnn_activation_desc >
 primitive_base (const primitive_id &id, const std::vector< primitive_id > &input, const padding &output_padding=padding())
 
 primitive_base (const cldnn_activation_desc *dto)
 

Additional Inherited Members

- Protected Attributes inherited from cldnn::primitive
primitive_id_arr _input
 

Detailed Description

Activation using rectified linear unit or parameterized rectified linear unit.

Can get one negative slope or negative slope per channel.

Algorithm:
out(i,x,y) = max(0, in(i,x,y)) + slope(i) * min(0, in(i,x,y))
Where:
  • out(i,x,y) : value at x, y from i-th feature map after activation.
  • in(i,x,y) : value at x, y from i-th feature map before activation.
  • slope(i) : the slope value of the i-th feature map (can be shared across channels or one slope per channel).

Definition at line 39 of file activation.hpp.

Constructor & Destructor Documentation

◆ activation() [1/2]

cldnn::activation::activation ( const primitive_id id,
const primitive_id input,
cldnn_activation_func  activation_func,
cldnn_activation_additional_params  additional_params = { 0.f,0.f },
const padding output_padding = padding() 
)
inline

Constructs Relu primitive.

Parameters
idThis primitive id.
inputInput primitive id.
activation_funcactivation function.
additional_paramsadditional params (slope/max_val/linear a,b).

Definition at line 48 of file activation.hpp.

◆ activation() [2/2]

cldnn::activation::activation ( const primitive_id id,
const primitive_id input,
const primitive_id additional_params_input,
cldnn_activation_func  activation_func,
const padding output_padding = padding() 
)
inline

Constructs activation with input per feature.

Parameters
idThis primitive id.
inputInput primitive id.
additional_params_inputadditional params stored on a memory. Input x dimension should be equal to input feature size (one value per channel. in case of linear is one pair per channel). All other dimensions should be 1.

Definition at line 68 of file activation.hpp.


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