This commit is contained in:
2026-04-28 23:23:57 +07:00
parent ced1c1c291
commit 229c5d85c4
4 changed files with 158 additions and 16 deletions
+27 -8
View File
@@ -1,9 +1,28 @@
#ifndef CORE_H
#define CORE_H
class NeuroEngine: {
private:
void* m_engine;
public:
NeuroEngine();
~NeuroEngine();
void* getEngine();
}
#include "typedef.h"
#include <vector>
#include <cmath>
#include <iostream>
#include <cstdlib>
class NeuralNetwork {
private:
int numLayers;
std::vector<int> layerSizes;
std::vector<std::vector<std::vector<double>>> weights; // weights[layer][to_node][from_node]
std::vector<std::vector<double>> biases; // biases[layer][node]
std::vector<std::vector<double>> outputs; // Храним выходы слоев для backprop
double sigmoid(double x) { return 1.0 / (1.0 + exp(-x)); }
double sigmoidDerivative(double x) { return x * (1.0 - x); }
public:
NeuralNetwork(LayerStructure_t layers[], int count);
std::vector<double> feedForward(std::vector<double> input);
void train(std::vector<double> input, std::vector<double> target, double learningRate);
};
#endif