clDNN
cldnn::fully_connected Struct Reference

Performs forward fully connected layer (inner product). Also supports built-in Relu cldnn_activation_desc available by setting it in arguments. . More...

#include <fully_connected.hpp>

Inheritance diagram for cldnn::fully_connected:
Collaboration diagram for cldnn::fully_connected:

Public Types

typedef cldnn_fully_connected_desc dto
 

Public Member Functions

 fully_connected (const primitive_id &id, const primitive_id &input, const primitive_id &weights, const primitive_id &bias="", bool with_activation=false, float activation_slp=0.0f, const padding &output_padding=padding())
 Constructs fully connected layer. More...
 
 fully_connected (const dto *dto)
 Constructs a copy from basic C API cldnn_fully_connected_desc.
 
- Public Member Functions inherited from cldnn::primitive_base< fully_connected, cldnn_fully_connected_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

primitive_id weights
 Primitive id containing weights data.
 
primitive_id bias
 Primitive id containing bias data.
 
bool with_activation
 Enable Relu activation.
 
float activation_negative_slope
 Relu activation slope.
 
- 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< fully_connected, cldnn_fully_connected_desc >
 primitive_base (const primitive_id &id, const std::vector< primitive_id > &input, const padding &output_padding=padding())
 
 primitive_base (const cldnn_fully_connected_desc *dto)
 

Additional Inherited Members

- Protected Attributes inherited from cldnn::primitive
primitive_id_arr _input
 

Detailed Description

Performs forward fully connected layer (inner product). Also supports built-in Relu cldnn_activation_desc available by setting it in arguments. .

  • Equation: Input[F x Y x F] x Output(X) == Weights(B x F x X x F) has to be fulfilled
  • Bias has to be linear data [1,1,1,X], where X is equal to number of outputs.
    Format support
    Data type activation format weights format
    F32 bfyx yxfb
    fyxb
    bs_xs_xsv8_bsv8
    bs_x_bsv16
    yxfb bfyx
    yxfb
    bs_xs_xsv8_bsv8
    F16 bfyx yxfb
    fyxb
    bs_x_bsv16
    yxfb bfyx

Definition at line 53 of file fully_connected.hpp.

Constructor & Destructor Documentation

◆ fully_connected()

cldnn::fully_connected::fully_connected ( const primitive_id id,
const primitive_id input,
const primitive_id weights,
const primitive_id bias = "",
bool  with_activation = false,
float  activation_slp = 0.0f,
const padding output_padding = padding() 
)
inline

Constructs fully connected layer.

Parameters
idThis primitive id.
inputInput primitive id.
weightsPrimitive id containing weights data.
biasPrimitive id containing bias data. Provide empty string if using Relu without bias.
with_activationEnable Relu activation.
activation_slpRelu activation slope.

Definition at line 64 of file fully_connected.hpp.


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