clDNN
cldnn::lrn Struct Reference

Local response normalization. More...

#include <lrn.hpp>

Inheritance diagram for cldnn::lrn:
Collaboration diagram for cldnn::lrn:

Public Types

typedef cldnn_lrn_desc dto
 

Public Member Functions

 lrn (const primitive_id &id, const primitive_id &input, uint32_t size, float k, float alpha, float beta, cldnn_lrn_norm_region lrn_norm_region, const padding &output_padding=padding())
 Constructs LRN primitive. More...
 
 lrn (const dto *dto)
 Constructs a copy from C API cldnn_normalization_desc.
 
- Public Member Functions inherited from cldnn::primitive_base< lrn, cldnn_lrn_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

uint32_t size
 Size of normalization.
 
float k
 Hyper parameter "k".
 
float alpha
 Hyper parameter "alpha".
 
float beta
 Hyper parameter "beta".
 
cldnn_lrn_norm_region norm_region
 Normalize across or within channel.
 
- 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

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

Additional Inherited Members

- Protected Attributes inherited from cldnn::primitive
primitive_id_arr _input
 

Detailed Description

Local response normalization.

LRN layer as described in chapter 3.3 of "ImageNet Classification with Deep Convolutional Neural Networks" by Khrizevsky, Sutskever, Hinton.
See: http://www.cs.toronto.edu/~fritz/absps/imagenet.pdf

Alogrithm:
b(i,x,y) = a(i,x,y) / (k+alpha*sum(min(N-1, i+n/2); j=max(0,i-n/2); a(j,x,y)^2))
Where:
  • b(i,x,y) : value at x, y from i-th feature map after normalization
  • a(i,x,y) : value at x, y from i-th feature map before normalization
  • N : number of feature maps
  • n : size of normalization
  • k, alpha, beta : hyper parameters (equal to 2, 10e-4, 0.75 in paper).

Definition at line 42 of file lrn.hpp.

Constructor & Destructor Documentation

◆ lrn()

cldnn::lrn::lrn ( const primitive_id id,
const primitive_id input,
uint32_t  size,
float  k,
float  alpha,
float  beta,
cldnn_lrn_norm_region  lrn_norm_region,
const padding output_padding = padding() 
)
inline

Constructs LRN primitive.

Parameters
idThis primitive id.
inputInput primitive id.
sizeSize of normalization.
kHyper parameter "k".
alphaHyper parameter "alpha".
betaHyper parameter "beta".
lrn_norm_regionNormalize across or within channel

Definition at line 54 of file lrn.hpp.


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