58 void train(
const Eigen::MatrixXd &input,
const Eigen::MatrixXd &target,
double learningRate,
int epochs);
69 double accuracy(
const Eigen::MatrixXd &X,
const Eigen::MatrixXd &Y);
80 Eigen::MatrixXd
predict(
const Eigen::MatrixXd &input)
82 auto outputs = forward(input);
83 return outputs.back();
93 std::vector<Layer> layers;
104 std::vector<Eigen::MatrixXd> forward(
const Eigen::MatrixXd &input);
116 std::vector<Eigen::MatrixXd> backward(
const std::vector<Eigen::MatrixXd> &outputs,
const Eigen::MatrixXd &target);
127 void updateWeights(
const std::vector<Eigen::MatrixXd> &gradients,
double learningRate);
Header file for the Layer class in the FlexNN neural network library.
Class representing a neural network.
Definition FlexNN.h:38
void train(const Eigen::MatrixXd &input, const Eigen::MatrixXd &target, double learningRate, int epochs)
Train the neural network.
Definition FlexNN.cpp:29
NeuralNetwork(const std::vector< Layer > &layers)
Constructor for the NeuralNetwork class.
Definition FlexNN.h:45
double accuracy(const Eigen::MatrixXd &X, const Eigen::MatrixXd &Y)
Calculate the accuracy of the neural network.
Definition FlexNN.cpp:53
Eigen::MatrixXd predict(const Eigen::MatrixXd &input)
Predict the output for given input data.
Definition FlexNN.h:80
Namespace for the FlexNN neural network library.