RTNeural  1.0.0
Real-time neural inferencing library
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
DenseT< T, in_sizet, out_sizet > Class Template Reference

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

outs [out_size]
 

Static Public Attributes

static constexpr auto in_size = in_sizet
 
static constexpr auto out_size = out_sizet
 

Detailed Description

template<typename T, int in_sizet, int out_sizet>
class RTNEURAL_NAMESPACE::DenseT< T, in_sizet, out_sizet >

Static implementation of a fully-connected (dense) layer, with no activation.

Constructor & Destructor Documentation

◆ DenseT()

DenseT ( )

Member Function Documentation

◆ getName()

std::string getName ( ) const
noexcept

Returns the name of this layer.

◆ isActivation()

constexpr bool isActivation ( ) const
constexprnoexcept

Returns false since dense is not an activation layer.

◆ reset()

RTNEURAL_REALTIME void reset ( )

Reset is a no-op, since Dense does not have state.

◆ forward()

RTNEURAL_REALTIME void forward ( const T(&)  ins[in_size])
noexcept

◆ setWeights() [1/2]

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.

◆ setWeights() [2/2]

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.

◆ setBias()

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.

Member Data Documentation

◆ in_size

constexpr auto in_size = in_sizet
staticconstexpr

◆ out_size

constexpr auto out_size = out_sizet
staticconstexpr

◆ outs

T outs[out_size]

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