Experimental alternative neural network modeled after equation system instead of linear algebra and derivatives.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 line
794B

  1. #include <xolatile/xeuron.c>
  2. int main (void) {
  3. //~int input [] = { 0, 0, 1, 1, 0, 1, 0, 1 }, output [] = { 0, 0, 0, 1 }; /* AND */
  4. //~int input [] = { 0, 0, 1, 1, 0, 1, 0, 1 }, output [] = { 0, 1, 1, 1 }; /* OR */
  5. int input [] = { 0, 0, 1, 1, 0, 1, 0, 1 }, output [] = { 0, 1, 1, 0 }; /* XOR */
  6. neuron_initialize (2, 4, input, output);
  7. neuron_configure ();
  8. //~neuron_system [0] = 0; /* AND */
  9. //~neuron_system [1] = 0;
  10. //~neuron_system [2] = 0;
  11. //~neuron_system [3] = 1;
  12. //~neuron_system [0] = 0; /* OR */
  13. //~neuron_system [1] = 1;
  14. //~neuron_system [2] = 1;
  15. //~neuron_system [3] = -1;
  16. neuron_system [0] = 0; /* XOR */
  17. neuron_system [1] = 1;
  18. neuron_system [2] = 1;
  19. neuron_system [3] = -2;
  20. neuron_print ();
  21. neuron_deinitialize ();
  22. return (EXIT_SUCCESS);
  23. }