Advertisement
Guest User

ai_script.m

a guest
Jan 24th, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. clear;
  2. clc;
  3.  
  4. NN = neuron;
  5.  
  6. disp("Starting Weights: ");
  7. disp(NN.synaptic_weights);
  8.  
  9. training_inputs = [0 0 1;
  10. 1 1 1;
  11. 1 0 1;
  12. 0 1 1];
  13. training_outputs = [0;
  14. 1;
  15. 1;
  16. 0];
  17. NN.train(training_inputs, training_outputs, 1000);
  18.  
  19. disp("Synaptic Weights AFTER Training: ");
  20. disp(NN.synaptic_weights');
  21. disp("Test Scenario");
  22. A = input("Value 1: ");
  23. B = input("Value 2: ");
  24. C = input("Value 3: ");
  25. fprintf("New Inputs: %d %d %d \n", A, B, C);
  26. fprintf("Output: %f \n", NN.think([A B C]));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement