Package trust.jfcm.learning

Examples of trust.jfcm.learning.LearningConcept


       
        if(c==null)
          System.err.println("Error: Concept "+e1.getConcept().getName()+" not found");
       
       
          LearningConcept lc = null;
          if(c instanceof LearningConcept)
            lc = (LearningConcept) c;
         
          if(lc != null && lc.isOutput()){
            OutputLearningConcept oc = (OutputLearningConcept) lc;
            System.out.println("  Output concept: "+c.getName());
            System.out.println("  Desirable output: "+oc.getDesirableOutput()+", output: "+oc.getOutput().doubleValue());
            System.out.println("  Error on output concept: "+c.getName()+": "+(oc.getDesirableOutput() - oc.getOutput().doubleValue()));
           
View Full Code Here


     
      if(c==null)
        System.err.println("Error: Concept "+e1.getConcept().getName()+" not found");
     
     
        LearningConcept lc = null;
        if(c instanceof LearningConcept)
          lc = (LearningConcept) c;
       
        if(lc != null && lc.isOutput()){
          OutputLearningConcept oc = (OutputLearningConcept) lc;
          error += Math.pow(oc.getOutput() - e1.getValue(), 2);
          //System.out.println("  OutputNode: "+c.getName()+": "+c.getOutput()+", desirable value: "+e1.getValue());
        }
       
View Full Code Here

     
      if(c==null)
        System.err.println("Error: Concept "+e1.getConcept().getName()+" not found");
     
     
        LearningConcept lc = null;
        if(c instanceof LearningConcept)
          lc = (LearningConcept) c;
       
        if(lc != null && lc.isOutput()){
          OutputLearningConcept oc = (OutputLearningConcept) lc;
          oc.setDesirableOutput(e1.getValue());
          //System.out.println("  OutputNode: "+c.getName()+": "+c.getOutput()+", desirable value: "+e1.getValue());
        }
       
View Full Code Here

      Iterator<Concept> it = map.getConceptsIterator();
      while(it.hasNext()){
        Concept c = it.next();
       
        if(c instanceof LearningConcept){
          LearningConcept lc = (LearningConcept) c;
          if(!lc.isErrorCalculated()){
           
           
           
           
            //error to be calculated
View Full Code Here

      WeightedConnection wconn = null;
      if(conn instanceof WeightedConnection)
        wconn = (WeightedConnection) conn;
     
      Concept cout = wconn.getTo();
      LearningConcept lout = null;
      if(cout instanceof LearningConcept)
        lout = (LearningConcept) cout;
     
      if(!lout.isErrorCalculated())
        /*
         * Error cannot be computed yet
         */
        return false;
     
      val += wconn.getWeight() * lout.getError();
     
    }
   
    /*
     * Set Error
View Full Code Here

  private void setTrainingInputs(List<EntryStructure> inputs){
    for(int i=0; i<inputs.size(); i++){
      EntryStructure e1 = inputs.get(i);
      //System.out.println("EntryStructure: "+e1);
     
      LearningConcept lc = (LearningConcept) e1.getConcept();
      if(lc != null && lc.isInput()){
        InputLearningConcept ilc = (InputLearningConcept) lc;
        ilc.setInput(e1.getValue());
      }

    }
View Full Code Here

    Iterator<Concept> it = map.getConcepts().values().iterator();
    while(it.hasNext()){
      Concept c = it.next();
       
      if(c instanceof LearningConcept){
        LearningConcept lc = (LearningConcept) c;
        Set<FcmConnection> out = lc.getOutConnections();
        Iterator<FcmConnection> it1 = out.iterator();
       
        while(it1.hasNext()){
          FcmConnection conn = it1.next();
         
          LearningWeightedConnection wconn = null;
          if(conn instanceof LearningWeightedConnection){
            wconn = (LearningWeightedConnection) conn;
            /*
             * Update learning connection
             */
            lc.getTrainingFunction().update(wconn);
          }
         
        }
         
      }     
 
View Full Code Here

  public void update(LearningWeightedConnection wconn) {
      double cWeight = wconn.getChangeInWeight();
      double weight = wconn.getWeight();
      double weightUncertainty = wconn.getWeightUncertainty();
     
      LearningConcept from = (LearningConcept) wconn.getFrom();
      double learnTimesError = learn * from.getError();
       
      /* Rule */
      //double delta = (learnTimesError * from.getOutput()) + (momentum * cWeight);
     
      double delta = 0;
      if(weight == weightUncertainty)
        delta = (learnTimesError * from.getOutput()) + (momentum * cWeight);
      else
        delta = (learnTimesError * weightUncertainty * from.getOutput()) + (momentum * cWeight);
     
      /*
      System.out.println("Connection: "+wconn);
      System.out.println("  learnTimesError: "+learnTimesError);
      System.out.println("  weightUncertainty: "+weightUncertainty);
View Full Code Here

       
        if(c==null)
          System.err.println("Error: Concept "+e1.getConcept().getName()+" not found");
       
       
          LearningConcept lc = null;
          if(c instanceof LearningConcept)
            lc = (LearningConcept) c;
         
          if(lc != null && lc.isOutput()){
            OutputLearningConcept oc = (OutputLearningConcept) lc;
            logger.debug("");
            logger.debug("  Output concept: "+c.getName());
            logger.debug("  Desirable output: "+oc.getDesirableOutput()+", output: "+oc.getOutput().doubleValue());
            logger.debug("  Error on output concept: "+c.getName()+": "+(oc.getDesirableOutput() - oc.getOutput().doubleValue()));
View Full Code Here

     
      if(c==null)
        System.err.println("Error: Concept "+e1.getConcept().getName()+" not found");
     
     
        LearningConcept lc = null;
        if(c instanceof LearningConcept)
          lc = (LearningConcept) c;
       
        if(lc != null && lc.isOutput()){
          OutputLearningConcept oc = (OutputLearningConcept) lc;
          error += Math.pow(oc.getOutput() - e1.getValue(), 2);
          //logger.debug("  OutputNode: "+c.getName()+": "+c.getOutput()+", desirable value: "+e1.getValue());
        }
       
View Full Code Here

TOP

Related Classes of trust.jfcm.learning.LearningConcept

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.