Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Perceptron
- http://deeplearningbook.com.br/o-perceptron-parte-1/
- */
- #include <iostream>
- using namespace std;
- int main()
- {
- float x1=0.0, x2=0.0, x3=0.0;
- float w1=6, w2=2, w3=2;
- float saida=0.0;
- float bias = 5.0;
- cout << "O tempo esta bom?(0 ate 1)" << endl;
- cin >> x1;
- cout << "Tem acompanhante?(0 ate 1)" << endl;
- cin >> x2;
- cout << "Tem dinheiro para o Uber?(0 ate 1)" << endl;
- cin >> x3;
- saida = (x1*w1+x2*w2+x3*w3) > bias;
- cout << endl;
- if(saida) cout << "A melhor opcao e aproveitar a noite!"<< endl;
- if(!saida) cout << "Ficar em casa nao eh ruim!"<< endl;
- //cout << "A chance de voce sair "<< saida*100 << "%";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement