ls
This commit is contained in:
+27
-8
@@ -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
|
||||
Reference in New Issue
Block a user