Static implementation of a fully-connected (dense) layer, with no activation. More...
Public Member Functions | |
DenseT () | |
std::string | getName () const noexcept |
Returns the name of this layer. More... | |
constexpr bool | isActivation () const noexcept |
Returns false since dense is not an activation layer. More... | |
RTNEURAL_REALTIME void | reset () |
Reset is a no-op, since Dense does not have state. More... | |
RTNEURAL_REALTIME void | forward (const T(&ins)[in_size]) noexcept |
Performs forward propagation for this layer. More... | |
RTNEURAL_REALTIME void | setWeights (const std::vector< std::vector< T >> &newWeights) |
Sets the layer weights from a given vector. More... | |
RTNEURAL_REALTIME void | setWeights (T **newWeights) |
Sets the layer weights from a given vector. More... | |
RTNEURAL_REALTIME void | setBias (const T *b) |
Sets the layer bias from a given array of size bias[out_size]. More... | |
Public Attributes | |
T | outs [out_size] |
Static Public Attributes | |
static constexpr auto | in_size = in_sizet |
static constexpr auto | out_size = out_sizet |
Static implementation of a fully-connected (dense) layer, with no activation.
DenseT | ( | ) |
|
noexcept |
Returns the name of this layer.
|
constexprnoexcept |
Returns false since dense is not an activation layer.
RTNEURAL_REALTIME void reset | ( | ) |
Reset is a no-op, since Dense does not have state.
|
noexcept |
Performs forward propagation for this layer.
References DenseT< T, in_sizet, out_sizet >::in_size, DenseT< T, in_sizet, out_sizet >::out_size, and DenseT< T, in_sizet, out_sizet >::outs.
RTNEURAL_REALTIME void setWeights | ( | const std::vector< std::vector< T >> & | newWeights | ) |
Sets the layer weights from a given vector.
The dimension of the weights vector must be weights[out_size][in_size]
References DenseT< T, in_sizet, out_sizet >::in_size, and DenseT< T, in_sizet, out_sizet >::out_size.
RTNEURAL_REALTIME void setWeights | ( | T ** | newWeights | ) |
Sets the layer weights from a given vector.
The dimension of the weights array must be weights[out_size][in_size]
References DenseT< T, in_sizet, out_sizet >::in_size, and DenseT< T, in_sizet, out_sizet >::out_size.
RTNEURAL_REALTIME void setBias | ( | const T * | b | ) |
Sets the layer bias from a given array of size bias[out_size].
References DenseT< T, in_sizet, out_sizet >::out_size.
|
staticconstexpr |
|
staticconstexpr |
T outs[out_size] |