Skip to content

Instantly share code, notes, and snippets.

@SmallJoker
Last active September 7, 2019 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SmallJoker/f0f625b5b4c2d9efbf8e312a8149ebed to your computer and use it in GitHub Desktop.
Save SmallJoker/f0f625b5b4c2d9efbf8e312a8149ebed to your computer and use it in GitHub Desktop.
neuron.cpp
/*
Example structure
┌─── NeuralLayer 1 ────┐
│ Inputs (source data) │
│ Outputs (1) │
└─────vvvvvvvvvvvv─────┘
┌─── NeuralLayer 2 ────┐
│ Inputs = Outputs (1) │
│ Outputs (2) │
└─────vvvvvvvvvvvv─────┘
┌─── NeuralLayer 3 ────┐
│ Inputs = Outputs (2) │
│ Final output │
└─────vvvvvvvvvvv──────┘
Result
The data flow goes in reverse:
The output neurons..
1) get the result from the input neurons
2) process the data according to: Neuron(<func>, <bias>)
The input neurons can point to either:
- A previous layer's output neurons
- the original data source: new Neuron(<value>)
NeuralLayer Structure
┌───────────────────────────┐
│ Input Neurons │
│ ^^ ^ Connections │
│ /\ | point to the │
│ / \ | inputs │
│ Output Neurons │
└───────────────────────────┘
Connections:
m_neuron refers to the input neuron
Neurons:
Can function as...
- Data sources: new Neuron(<value>)
- Processor: Neuron(<func>, <bias>)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment