geopm  3.1.1.dev214+gba4f9f6d
GEOPM - Global Extensible Open Power Manager
Public Member Functions | Static Public Member Functions | List of all members
geopm::DenseLayer Class Referenceabstract

Class to store dense layers and perform operations on the layers' 1D and 2D Tensors, aka vectors and matrices, suitable for use in feed-forward neural networks. More...

#include <DenseLayer.hpp>

Inheritance diagram for geopm::DenseLayer:
Inheritance graph
[legend]

Public Member Functions

virtual ~DenseLayer ()=default
 
virtual TensorOneD forward (const TensorOneD &input) const =0
 Perform inference using the instance weights and biases. More...
 
virtual size_t get_input_dim () const =0
 Get the dimension required for the input TensorOneD. More...
 
virtual size_t get_output_dim () const =0
 Get the dimension of the resulting TensorOneD. More...
 
TensorOneD operator() (const TensorOneD &input) const
 

Static Public Member Functions

static std::unique_ptr< DenseLayermake_unique (const TensorTwoD &weights, const TensorOneD &biases)
 Returns a unique_ptr to a concrete object constructed using the underlying implementation from an pair of weights and biases. More...
 

Detailed Description

Class to store dense layers and perform operations on the layers' 1D and 2D Tensors, aka vectors and matrices, suitable for use in feed-forward neural networks.

Constructor & Destructor Documentation

◆ ~DenseLayer()

virtual geopm::DenseLayer::~DenseLayer ( )
virtualdefault

Member Function Documentation

◆ forward()

virtual TensorOneD geopm::DenseLayer::forward ( const TensorOneD input) const
pure virtual

Perform inference using the instance weights and biases.

Parameters
[in]inputTensorOneD vector of input signals.
Exceptions
geopm::Exceptionif input dimension is incompatible with the DenseLayer.
Returns
Returns a TensorOneD vector of output values.

Implemented in geopm::DenseLayerImp.

◆ get_input_dim()

virtual size_t geopm::DenseLayer::get_input_dim ( ) const
pure virtual

Get the dimension required for the input TensorOneD.

Returns
Returns a size_t equal to the number of columns of weights

Implemented in geopm::DenseLayerImp.

◆ get_output_dim()

virtual size_t geopm::DenseLayer::get_output_dim ( ) const
pure virtual

Get the dimension of the resulting TensorOneD.

Returns
Returns a size_t equal to the number of rows of weights

Implemented in geopm::DenseLayerImp.

◆ make_unique()

std::unique_ptr< DenseLayer > geopm::DenseLayer::make_unique ( const TensorTwoD weights,
const TensorOneD biases 
)
static

Returns a unique_ptr to a concrete object constructed using the underlying implementation from an pair of weights and biases.

Parameters
[in]weightmatrix (TensorTwoD instance)
[in]biasvector (TensorOneD instance)
Exceptions
geopm::Exceptionif weights is empty
geopm::Exceptionif weights and biases dimensions are incompatible. i.e. if weights rows is inequal to bias dimension.

◆ operator()()

TensorOneD geopm::DenseLayer::operator() ( const TensorOneD input) const

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