Files
BiPy/Xenith/core.h
T
2026-04-29 02:05:59 +07:00

25 lines
685 B
C++

#ifndef CORE_H
#define CORE_H
#include "typedef.h"
#include <vector>
#include <cmath>
class NeuralNetwork {
private:
int numLayers;
std::vector<int> sizes;
std::vector<std::vector<std::vector<double>>> weights;
std::vector<std::vector<double>> biases;
std::vector<std::vector<double>> outputs;
double sigmoid(double x) { return 1.0 / (1.0 + exp(-x)); }
double sigmoidDeriv(double x) { return x * (1.0 - x); }
public:
NeuralNetwork(LayerStructure_t layers[], int count);
std::vector<double> feedForward(const std::vector<double>& input);
double train(const std::vector<double>& input, const std::vector<double>& target, double lr);
};
#endif