geopm 3.2.1.dev535+ga96c120fc
GEOPM - Global Extensible Open Power Manager
Loading...
Searching...
No Matches
geopm::DenseLayerImp Class Reference

#include <DenseLayerImp.hpp>

Inheritance diagram for geopm::DenseLayerImp:
Collaboration diagram for geopm::DenseLayerImp:

Public Member Functions

 DenseLayerImp (const TensorTwoD &weights, const TensorOneD &biases)
 Constructor ingesting a TensoTwoD and TensorOneD object.
TensorOneD forward (const TensorOneD &input) const override
 Inference step.
size_t get_input_dim () const override
 Get the dimension required for the input TensorOneD.
size_t get_output_dim () const override
 Get the dimension of the resulting TensorOneD.
Public Member Functions inherited from geopm::DenseLayer
virtual ~DenseLayer ()=default
TensorOneD operator() (const TensorOneD &input) const

Additional Inherited Members

Static Public Member Functions inherited from geopm::DenseLayer
static std::unique_ptr< DenseLayer > make_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.

Constructor & Destructor Documentation

◆ DenseLayerImp()

geopm::DenseLayerImp::DenseLayerImp ( const TensorTwoD & weights,
const TensorOneD & biases )

Constructor ingesting a TensoTwoD and TensorOneD object.

Parameters
[in]weightsThe TensorTwoD object containing weights
[in]biasesThe TensorOneD object containing biases
Exceptions
geopm::Exceptionif the weights is empty
geopm::Exceptionif the dimensions are incompatible, i.e. if weights rows is inequal to bias dimension.

Member Function Documentation

◆ forward()

TensorOneD geopm::DenseLayerImp::forward ( const TensorOneD & input) const
overridevirtual

Inference step.

Parameters
[in]inputThe TensorOneD object operating upon the DenseLayer
Exceptions
geopm::Exceptionif input vector is incompatible with the DenseLayer
Returns
Returns a TensorOneD object of output values

Implements geopm::DenseLayer.

◆ get_input_dim()

size_t geopm::DenseLayerImp::get_input_dim ( ) const
overridevirtual

Get the dimension required for the input TensorOneD.

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

Implements geopm::DenseLayer.

◆ get_output_dim()

size_t geopm::DenseLayerImp::get_output_dim ( ) const
overridevirtual

Get the dimension of the resulting TensorOneD.

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

Implements geopm::DenseLayer.


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