Scheduler
polynomialNetwork.h
Go to the documentation of this file.
1 
10 #ifndef POLYNOMIAL_NETWORK_H
11 #define POLYNOMIAL_NETWORK_H
12 
13 #include "approximatedFunction.h"
14 
15 namespace Mdp
16 {
17 
18 struct context;
19 
21 {
22 public:
23  PolynomialNetwork(std::shared_ptr<Context> context, size_t inputSize, size_t outputSize, size_t nbOfHiddenLayers);
24  std::vector<double> getParamVector() override;
25  std::vector<double> getOutput(std::vector<double> input) override;
26  void learnExample(std::vector<double> input, std::vector<double> output) override;
27  void initializeWeights(std::vector<std::vector<double>> inputWeights,
28  std::vector<std::vector<double>> outputWeights);
29  double getValue(state_t s, action_t a);
30  std::vector<double> getValues(state_t s);
31  void updateParameters(double coeff);
32  void setAlpha(double alpha);
33 protected:
34  void init(std::shared_ptr<Context> context);
35  size_t hiddenSize{0};
36  std::vector<double> hiddenLayer;
37  std::vector<std::vector<double>> inputWeights;
38  std::vector<std::vector<double>> outputWeights;
39 };
40 
41 }
42 
43 #endif
void initializeWeights(std::vector< std::vector< double >> inputWeights, std::vector< std::vector< double >> outputWeights)
void setAlpha(double alpha)
double getValue(state_t s, action_t a)
std::vector< std::vector< double > > outputWeights
void learnExample(std::vector< double > input, std::vector< double > output) override
std::vector< double > hiddenLayer
std::vector< double > getValues(state_t s)
std::vector< double > getParamVector() override
PolynomialNetwork(std::shared_ptr< Context > context, size_t inputSize, size_t outputSize, size_t nbOfHiddenLayers)
size_t action_t
Definition: action_impl.h:18
void updateParameters(double coeff)
Definition: action.h:18
std::vector< double > getOutput(std::vector< double > input) override
size_t state_t
Definition: state.h:19
void init(std::shared_ptr< Context > context)
std::vector< std::vector< double > > inputWeights