RTNeural  1.0.0
Real-time neural inferencing library
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
BatchNorm2DT< T, num_filters_t, num_features_t, affine > Class Template Reference

Static batch normalization layer. More...

Public Member Functions

 BatchNorm2DT ()
 
std::string getName () const noexcept
 Returns the name of this layer. More...
 
constexpr bool isActivation () const noexcept
 Returns false since batch-norm is not an activation layer. More...
 
RTNEURAL_REALTIME void reset ()
 Resets the layer state. More...
 
template<bool isAffine = affine>
RTNEURAL_REALTIME std::enable_if< isAffine, void >::type forward (const T(&ins)[in_size]) noexcept
 Performs forward propagation for this layer. More...
 
template<bool isAffine = affine>
RTNEURAL_REALTIME std::enable_if<!isAffine, void >::type forward (const T(&ins)[in_size]) noexcept
 Performs forward propagation for this layer. More...
 
template<bool isAffine = affine>
RTNEURAL_REALTIME std::enable_if< isAffine, void >::type setGamma (const std::vector< T > &gammaVals)
 Sets the layer "gamma" values. More...
 
template<bool isAffine = affine>
RTNEURAL_REALTIME std::enable_if<!isAffine, void >::type setGamma (const std::vector< T > &)
 Sets the layer "gamma" values. More...
 
template<bool isAffine = affine>
RTNEURAL_REALTIME std::enable_if< isAffine, void >::type setBeta (const std::vector< T > &betaVals)
 Sets the layer "beta" values. More...
 
template<bool isAffine = affine>
RTNEURAL_REALTIME std::enable_if<!isAffine, void >::type setBeta (const std::vector< T > &)
 Sets the layer "beta" values. More...
 
RTNEURAL_REALTIME void setRunningMean (const std::vector< T > &runningMean)
 Sets the layer's trained running mean. More...
 
RTNEURAL_REALTIME void setRunningVariance (const std::vector< T > &runningVar)
 Set's the layer's trained running variance. More...
 
RTNEURAL_REALTIME void setEpsilon (T epsilon)
 Set's the layer "epsilon" value. More...
 

Public Attributes

outs [out_size]
 

Static Public Attributes

static constexpr auto in_size = num_filters_t * num_features_t
 
static constexpr auto out_size = num_filters_t * num_features_t
 
static constexpr auto num_filters = num_filters_t
 
static constexpr auto num_features = num_features_t
 
static constexpr bool is_affine = affine
 

Detailed Description

template<typename T, int num_filters_t, int num_features_t, bool affine = true>
class RTNEURAL_NAMESPACE::BatchNorm2DT< T, num_filters_t, num_features_t, affine >

Static batch normalization layer.

Constructor & Destructor Documentation

◆ BatchNorm2DT()

Member Function Documentation

◆ getName()

std::string getName ( ) const
noexcept

Returns the name of this layer.

◆ isActivation()

constexpr bool isActivation ( ) const
constexprnoexcept

Returns false since batch-norm is not an activation layer.

◆ reset()

RTNEURAL_REALTIME void reset ( )

Resets the layer state.

◆ forward() [1/2]

RTNEURAL_REALTIME std::enable_if<isAffine, void>::type forward ( const T(&)  ins[in_size])
noexcept

◆ forward() [2/2]

RTNEURAL_REALTIME std::enable_if<!isAffine, void>::type forward ( const T(&)  ins[in_size])
noexcept

◆ setGamma() [1/2]

RTNEURAL_REALTIME std::enable_if<isAffine, void>::type setGamma ( const std::vector< T > &  gammaVals)

Sets the layer "gamma" values.

◆ setGamma() [2/2]

RTNEURAL_REALTIME std::enable_if<!isAffine, void>::type setGamma ( const std::vector< T > &  )

Sets the layer "gamma" values.

◆ setBeta() [1/2]

RTNEURAL_REALTIME std::enable_if<isAffine, void>::type setBeta ( const std::vector< T > &  betaVals)

Sets the layer "beta" values.

◆ setBeta() [2/2]

RTNEURAL_REALTIME std::enable_if<!isAffine, void>::type setBeta ( const std::vector< T > &  )

Sets the layer "beta" values.

◆ setRunningMean()

RTNEURAL_REALTIME void setRunningMean ( const std::vector< T > &  runningMean)

Sets the layer's trained running mean.

◆ setRunningVariance()

RTNEURAL_REALTIME void setRunningVariance ( const std::vector< T > &  runningVar)

Set's the layer's trained running variance.

◆ setEpsilon()

RTNEURAL_REALTIME void setEpsilon ( epsilon)

Set's the layer "epsilon" value.

Member Data Documentation

◆ in_size

constexpr auto in_size = num_filters_t * num_features_t
staticconstexpr

◆ out_size

constexpr auto out_size = num_filters_t * num_features_t
staticconstexpr

◆ num_filters

constexpr auto num_filters = num_filters_t
staticconstexpr

◆ num_features

constexpr auto num_features = num_features_t
staticconstexpr

◆ is_affine

constexpr bool is_affine = affine
staticconstexpr

◆ outs

T outs[out_size]

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