Advertisement
fabioceep

IA - Perceptron

Oct 31st, 2019
504
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. /*
  2.  
  3. Perceptron
  4.  
  5. http://deeplearningbook.com.br/o-perceptron-parte-1/
  6.  
  7. */
  8. #include <iostream>
  9.  
  10. using namespace std;
  11.  
  12. int main()
  13. {
  14.     float x1=0.0, x2=0.0, x3=0.0;
  15.     float w1=6, w2=2, w3=2;
  16.     float saida=0.0;
  17.     float bias = 5.0;
  18.  
  19.     cout << "O tempo esta bom?(0 ate 1)" << endl;
  20.     cin >> x1;
  21.  
  22.     cout << "Tem acompanhante?(0 ate 1)" << endl;
  23.     cin >> x2;
  24.  
  25.     cout << "Tem dinheiro para o Uber?(0 ate 1)" << endl;
  26.     cin >> x3;
  27.  
  28.     saida = (x1*w1+x2*w2+x3*w3) > bias;
  29.  
  30.     cout << endl;
  31.     if(saida) cout << "A melhor opcao e aproveitar a noite!"<< endl;
  32.     if(!saida) cout << "Ficar em casa nao eh ruim!"<< endl;
  33.  
  34.     //cout << "A chance de voce sair "<< saida*100 << "%";
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement