Advertisement
Guest User

nn.h

a guest
Feb 18th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 KB | None | 0 0
  1. #ifndef NN_INCLUDED
  2. #define NN_INCLUDED
  3.  
  4. #include <stdio.h>
  5. #include <math.h>
  6. #include "jackstd.h"
  7.  
  8. #define NN_NUMINPUTS    4
  9. #define NN_NUMHIDDEN    20
  10. #define NN_NUMOUTPUTS   4
  11. #define NN_NUMWEIGHTS ((NN_NUMINPUTS+1)*NN_NUMHIDDEN + (NN_NUMHIDDEN+1)*NN_NUMHIDDEN + (NN_NUMHIDDEN+1)*NN_NUMOUTPUTS)
  12.  
  13.  
  14. typedef struct {
  15.     float input[NN_NUMINPUTS];
  16.     float output[NN_NUMOUTPUTS];
  17.     float weight[NN_NUMWEIGHTS];
  18. } nn;
  19.  
  20.  
  21. void nn_process(nn *net);
  22. void nn_fillrandom(nn *net);
  23. void nn_mutate(nn *net);
  24. void nn_copy(nn *dest, nn *src);
  25.  
  26. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement