geopm  3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
LocalNeuralNet.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 LOCALNEURALNET_HPP_INCLUDE
7 #define LOCALNEURALNET_HPP_INCLUDE
8 
9 #include "DenseLayer.hpp"
10 #include "TensorOneD.hpp"
11 
12 namespace geopm
13 {
14  class TensorTwoD;
15 
18 
20  {
21  public:
22  virtual ~LocalNeuralNet() = default;
28  static std::unique_ptr<LocalNeuralNet> make_unique(std::vector<std::shared_ptr<DenseLayer> > layers);
37  virtual TensorOneD forward(const TensorOneD &inp) const = 0;
41  virtual size_t get_input_dim() const = 0;
45  virtual size_t get_output_dim() const = 0;
46 
47  TensorOneD operator()(const TensorOneD &input) const;
48  };
49 }
50 
51 #endif /* LOCALNEURALNET_HPP_INCLUDE */
Class to manage data and operations of feed forward neural nets required for neural net inference.
Definition: LocalNeuralNet.hpp:20
virtual ~LocalNeuralNet()=default
virtual size_t get_input_dim() const =0
Get the dimension required for the input TensorOneD.
static std::unique_ptr< LocalNeuralNet > make_unique(std::vector< std::shared_ptr< DenseLayer > > layers)
Returns a unique_ptr to a concrete object constructed using the underlying implementation from a vect...
Definition: LocalNeuralNet.cpp:18
virtual size_t get_output_dim() const =0
Get the dimension of the resulting TensorOneD.
virtual TensorOneD forward(const TensorOneD &inp) const =0
Perform inference using the instance weights and biases.
TensorOneD operator()(const TensorOneD &input) const
Definition: LocalNeuralNet.cpp:73
Class to store and perform operations on 1D Tensors, aka vectors, suitable for use in feed-forward ne...
Definition: TensorOneD.hpp:21
Definition: Accumulator.cpp:12