Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Neuron
- {
- float m_value = 0;
- int m_numberOfWeights;
- std::vector m_weights;
- Neuron(int numberOfWeights)
- {
- m_numberOfWeights = numberOfWeights;
- m_weights.reserve(numberOfWeights);
- for(int weightIndex = 0;weightIndex < m_numberOfWeights;weightIndex++)
- {
- m_weights.push_back(GetRandomFloatInRange(-1,1));
- }
- }
- void SetRandomWeights()
- {
- for (int weightIndex = 0; weightIndex < m_numberOfWeights; weightIndex++)
- {
- m_weights.at(weightIndex) = GetRandomFloatInRange(-1, 1);
- }
- }
- };
Add Comment
Please, Sign In to add comment