All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.basking2.sdsai.sandbox.ai.nnet.EgressEdge Maven / Gradle / Ivy

The newest version!
/* $Id: EgressEdge.java 281 2005-12-29 22:59:47Z sam $ */

package com.github.basking2.sdsai.sandbox.ai.nnet;


public class EgressEdge extends HiddenEdge {
  
  int outputVersion;
  double output;
  double target;
  
  public EgressEdge(HiddenNode s){
    src = s;
    dst = null;
    s.addOutEdge(this);
    weight=1;
  }
  
  public double getOutput(int v){ 
    if(outputVersion!=v){
      outputVersion=v;
      output=((HiddenNode)src).getOutput(v);
    }
    
    return output;
  }
  
  public double getSigma(int v) { 
    if(outputVersion!=v){
      outputVersion = v; 
      output = ((HiddenNode)src).getOutput(v);
    }
    return output*(1-output)*(target-output);
  }
  
  public void update(int v){ update(v, ETA); }
  public void update(int v, double eta){ ((HiddenNode)src).update(v,eta); }
  public void setTarget(double d){ target=d; }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy