+/GENN

genetically evolving neural networks

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

P1n3appl3avg fitness still falling to NaN needs fixba3e27e

v0.2
807 B44 linesraw
1#ifndef GENN_GENOME_H
2#define GENN_GENOME_H
3
4#include "math.h"
5#include <sstream>
6#include <stdlib.h>
7#include "Components.h"
8
9class Genome {
10public:
11    std::vector<Connection *> structure;
12    std::vector<Neuron *> nodes;
13    int inputs, outputs, totalNodes, totalConnections;
14    double mutationRates[7];
15    double fitness = 0, adjustedFitness = 0;
16
17    double sigmoid(double);
18
19    Genome(std::string);
20
21    Genome(int, int, double[]);
22
23    ~Genome();
24
25    void propagate(double *, double *);
26
27    std::string encode();
28
29    void decode(std::string);
30
31    void recomputeInputs();
32
33    bool hasConnection(int, int);
34
35    void reset();
36
37    static bool compare(Genome* a, Genome* b) { return (a->fitness > b->fitness); }
38
39    //deletes disabled connections
40    void clean();
41};
42
43
44#endif //GENN_NETWORK_H