Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package rdn;
- public class RedeNeural {
- final double x1, x2, w1, w2;
- RedeNeural(double x1, double x2, double w1, double w2) {
- this.x1 = x1;
- this.x2 = x2;
- this.w1 = w1;
- this.w2 = w2;
- }
- public double getY1() {
- double wx, y1;
- wx = (x1 * w1) + (x2 * w2); //func propaga
- if(wx>0){
- y1 = 1;
- }else{
- y1 = 0;
- }
- System.out.println((int) wx);
- // y1 = Math.tanh(wx); //Saida
- return y1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement