diff options
Diffstat (limited to 'NNUtils.hpp')
-rw-r--r-- | NNUtils.hpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/NNUtils.hpp b/NNUtils.hpp new file mode 100644 index 0000000..e2c12ba --- /dev/null +++ b/NNUtils.hpp @@ -0,0 +1,28 @@ +#ifndef __NNUTILS_HPP__ +#define __NNUTILS_HPP__ + +#include <cmath> +#include <vector> +#include <random> +#include <chrono> +#include <memory> + +enum NodeClass { NEURON, MEMORY_CELL }; + +enum NeuralNetClass { SINGLE_MLP, DUAL_MLP, SIMPLE_RN, FULLY_RN }; + +typedef std::vector<float> Chromosome; + +void seedRand(); + +float realRand(float low, float hi); + +int intRand(int low, int hi); + +float sigmoid(float input, float sensitivity = 1.f); + +void crossover(const Chromosome &parent, const Chromosome &mother, Chromosome &child1, Chromosome &child2); + +void mutate(Chromosome &chromosome, float mutationRate = 0.001f); + +#endif // __NNUTILS_HPP__ |