Guest User

Untitled

a guest
Nov 17th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. struct Neuron
  2. {
  3. float m_value = 0;
  4. int m_numberOfWeights;
  5. std::vector m_weights;
  6. Neuron(int numberOfWeights)
  7. {
  8. m_numberOfWeights = numberOfWeights;
  9. m_weights.reserve(numberOfWeights);
  10. for(int weightIndex = 0;weightIndex < m_numberOfWeights;weightIndex++)
  11. {
  12. m_weights.push_back(GetRandomFloatInRange(-1,1));
  13. }
  14. }
  15. void SetRandomWeights()
  16. {
  17. for (int weightIndex = 0; weightIndex < m_numberOfWeights; weightIndex++)
  18. {
  19. m_weights.at(weightIndex) = GetRandomFloatInRange(-1, 1);
  20. }
  21. }
  22.  
  23. };
Add Comment
Please, Sign In to add comment