Advertisement
fabioceep

C++: Custo IA MSE

Nov 6th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include<math.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. float saida[]={0.5,0.8,0.7,0.6,0.9};
  9. float resposta[]={1,0,0,0,0,0};
  10. float custo[]={0.0};
  11. float MSE = 0;
  12.  
  13. int i;
  14.  
  15. for(i=0;i<5;i++){
  16. custo[i]=pow((saida[i]-resposta[i]),2);
  17. MSE += custo[i];
  18. cout << custo[i] << endl;
  19. }
  20. cout << MSE << endl;
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement