30#ifndef ARTIFICIALNEURALNET_H
31#define ARTIFICIALNEURALNET_H
34#include "MemoryManager.h"
41#define ANN_ACTIVATION_LINEAR 0
42#define ANN_ACTIVATION_STEP 1
43#define ANN_ACTIVATION_SIGMOID 2
46#define ANN_WEIGHT_MIN -2
47#define ANN_WEIGHT_MAX 2
48#define ANN_PRECISION 0.000001
51double generateWeights(
double dMin = ANN_WEIGHT_MIN,
double dMax = ANN_WEIGHT_MAX);
53double applyWeightPrecision(
double);
62 vector<double> vWeight;
65 Neuron(Sint32 NumInputs);
75 vector<Neuron> vNeurons;
77 NeuronLayer(Sint32, Sint32);
81class ArtificialNeuralNet
84 ArtificialNeuralNet();
85 void init(Sint32, Sint32, Sint32, Sint32);
88 void setActivationFunction(Sint32);
89 Sint32 getActivationFunction();
92 vector<double> getWeights();
95 Sint32 getNumOutputs();
96 Sint32 getNumInputs();
97 Sint32 getNumHiddenLayers();
98 Sint32 getNumNeuronsPerLayer();
101 Sint32 getNumberOfWeights();
104 Sint32 setWeights(vector<double> &vW);
107 vector<double> update(vector<double> &inputs);
110 Sint32 iActivationFunc;
113 Sint32 iNumHiddenLayers;
114 Sint32 iNeuronsPerHiddenLyr;
117 vector<NeuronLayer> vNeuronsLayers;
120 inline double sigmoid(
double,
double);
121 inline double linear(
double,
double);
122 inline double step(
double,
double);