+/GENN

genetically evolving neural networks

git clone https://git.julia.blue/+/GENN

Joseph RyanRestructure file system add graphics libcc48e92

imdone-todo-updates
664 B45 linesraw
1#ifndef GENN_NETWORK_H
2#define GENN_NETWORK_H
3
4#include "Genome.h"
5#include <cmath>
6
7struct Neuron {
8    Neuron(int a) {
9        id = a;
10    }
11
12    int id = -1;
13    double value = 0, sum = 0;
14};
15
16struct Connection {
17    Connection(double a) {
18        weight = a;
19    }
20
21    Neuron *in;
22    Neuron *out;
23    double weight;
24};
25
26class Network {
27private:
28    double sigmoid(double);
29
30    std::vector<Neuron *> inputs;
31    std::vector<Neuron *> hiddenNodes;
32    std::vector<Neuron *> outputs;
33    std::vector<Connection> structure;
34public:
35    Network(Genome &);
36
37    ~Network();
38
39    void propagate(double *, double *);
40
41    void reset();
42};
43
44
45#endif //GENN_NETWORK_H