geopm  3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
DenseLayerImp.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 - 2024 Intel Corporation
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef DENSELAYERIMP_HPP_INCLUDE
7 #define DENSELAYERIMP_HPP_INCLUDE
8 
9 #include "DenseLayer.hpp"
10 
11 #include "TensorOneD.hpp"
12 #include "TensorTwoD.hpp"
13 
14 namespace geopm
15 {
16  class DenseLayerImp : public DenseLayer
17  {
18  public:
29  DenseLayerImp(const TensorTwoD &weights, const TensorOneD &biases);
37  TensorOneD forward(const TensorOneD &input) const override;
41  size_t get_input_dim() const override;
45  size_t get_output_dim() const override;
46 
47  private:
48  TensorTwoD m_weights;
49  TensorOneD m_biases;
50  };
51 }
52 
53 #endif /* DENSELAYERIMP_HPP_INCLUDE */
Class to store dense layers and perform operations on the layers' 1D and 2D Tensors,...
Definition: DenseLayer.hpp:19
Definition: DenseLayerImp.hpp:17
DenseLayerImp(const TensorTwoD &weights, const TensorOneD &biases)
Constructor ingesting a TensoTwoD and TensorOneD object.
Definition: DenseLayer.cpp:27
size_t get_input_dim() const override
Get the dimension required for the input TensorOneD.
Definition: DenseLayer.cpp:55
TensorOneD forward(const TensorOneD &input) const override
Inference step.
Definition: DenseLayer.cpp:44
size_t get_output_dim() const override
Get the dimension of the resulting TensorOneD.
Definition: DenseLayer.cpp:60
Class to store and perform operations on 1D Tensors, aka vectors, suitable for use in feed-forward ne...
Definition: TensorOneD.hpp:21
Class to manage data and operations related to 2D Tensors required for neural net inference.
Definition: TensorTwoD.hpp:22
Definition: Accumulator.cpp:12