aboutsummaryrefslogtreecommitdiff
path: root/Neuron.hpp
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2024-02-29 03:15:03 +0100
committerPaul Oliver <contact@pauloliver.dev>2024-02-29 03:15:30 +0100
commit6fd23da97fa9700f59c61a966b4bf7d25fa46b34 (patch)
treed5fe3a8305a5f57e5b4cedc8300e951c74696cc5 /Neuron.hpp
initial commitHEADmaster
Diffstat (limited to 'Neuron.hpp')
-rw-r--r--Neuron.hpp22
1 files changed, 22 insertions, 0 deletions
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<float> &inputs);
+
+private:
+ std::vector<float> m_weights;
+ float m_bias = 0.f;
+};
+
+#endif // __NEURON_HPP__