NeuralNet 1.0
Loading...
Searching...
No Matches
Optimizer.hpp
1#pragma once
2
3#include <Eigen/Dense>
4
5namespace NeuralNet {
6class Optimizer {
7 friend class Network;
8
9 public:
10 Optimizer(double alpha) : alpha(alpha){};
11
12 virtual ~Optimizer() = default; // Virtual destructor
13
24 virtual void updateWeights(Eigen::MatrixXd &weights,
25 const Eigen::MatrixXd &weightsGrad) = 0;
26
37 virtual void updateBiases(Eigen::MatrixXd &biases,
38 const Eigen::MatrixXd &biasesGrad) = 0;
39
40 protected:
41 double alpha;
42
52 virtual void insiderInit(size_t size) = 0;
53};
54} // namespace NeuralNet
Definition Network.hpp:29
Definition Optimizer.hpp:6
virtual void updateBiases(Eigen::MatrixXd &biases, const Eigen::MatrixXd &biasesGrad)=0
This function updates the biases passed based based on the Optimizer and the biases gradients.
virtual void insiderInit(size_t size)=0
This function's purpose is to provide an interface to perform updates for the Optimizers from within ...
virtual void updateWeights(Eigen::MatrixXd &weights, const Eigen::MatrixXd &weightsGrad)=0
This function updates the weights passed based on the selected Optimizer and the weights gradients.