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 | |
T | 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 |
Static batch normalization layer.
BatchNorm2DT | ( | ) |
|
noexcept |
Returns the name of this layer.
|
constexprnoexcept |
Returns false since batch-norm is not an activation layer.
RTNEURAL_REALTIME void reset | ( | ) |
Resets the layer state.
|
noexcept |
Performs forward propagation for this layer.
References BatchNorm2DT< T, num_filters_t, num_features_t, affine >::num_features, BatchNorm2DT< T, num_filters_t, num_features_t, affine >::num_filters, and BatchNorm2DT< T, num_filters_t, num_features_t, affine >::outs.
|
noexcept |
Performs forward propagation for this layer.
References BatchNorm2DT< T, num_filters_t, num_features_t, affine >::num_features, BatchNorm2DT< T, num_filters_t, num_features_t, affine >::num_filters, and BatchNorm2DT< T, num_filters_t, num_features_t, affine >::outs.
RTNEURAL_REALTIME std::enable_if<isAffine, void>::type setGamma | ( | const std::vector< T > & | gammaVals | ) |
Sets the layer "gamma" values.
RTNEURAL_REALTIME std::enable_if<!isAffine, void>::type setGamma | ( | const std::vector< T > & | ) |
Sets the layer "gamma" values.
RTNEURAL_REALTIME std::enable_if<isAffine, void>::type setBeta | ( | const std::vector< T > & | betaVals | ) |
Sets the layer "beta" values.
RTNEURAL_REALTIME std::enable_if<!isAffine, void>::type setBeta | ( | const std::vector< T > & | ) |
Sets the layer "beta" values.
RTNEURAL_REALTIME void setRunningMean | ( | const std::vector< T > & | runningMean | ) |
Sets the layer's trained running mean.
RTNEURAL_REALTIME void setRunningVariance | ( | const std::vector< T > & | runningVar | ) |
Set's the layer's trained running variance.
RTNEURAL_REALTIME void setEpsilon | ( | T | epsilon | ) |
Set's the layer "epsilon" value.
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
T outs[out_size] |