From 6fd23da97fa9700f59c61a966b4bf7d25fa46b34 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Thu, 29 Feb 2024 03:15:03 +0100 Subject: initial commit --- Neuron.hpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Neuron.hpp (limited to 'Neuron.hpp') diff --git a/Neuron.hpp b/Neuron.hpp new file mode 100644 index 0000000..f2f7269 --- /dev/null +++ b/Neuron.hpp @@ -0,0 +1,22 @@ +#ifndef __NEURON_HPP__ +#define __NEURON_HPP__ + +#include "Node.hpp" + +class Neuron : public Node +{ +public: + Neuron(unsigned inputCount, bool zeroed = false); + + void setChromosome(const Chromosome &chromosome); + Chromosome getChromosome() const; + unsigned getChromosomeSize() const { return m_inputCount + 1; } + + float io(const std::vector &inputs); + +private: + std::vector m_weights; + float m_bias = 0.f; +}; + +#endif // __NEURON_HPP__ -- cgit v1.2.1