Package trust.jfcm

Examples of trust.jfcm.Concept


     * compute errors on the output nodes
     */
    double error = 0;
    for(int i=0; i<outputs.size(); i++){
      EntryStructure e1 = outputs.get(i);
      Concept c = e1.getConcept();
     
      if(c==null)
        System.err.println("Error: Concept "+e1.getConcept().getName()+" not found");
     
     
View Full Code Here


     * Set desirable outputs and compute the mean error
     */
    double sum=0;
    for(int i=0; i<outputs.size(); i++){
      EntryStructure e1 = outputs.get(i);
      Concept c = e1.getConcept();
     
      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());
          sum += oc.getDesirableOutput() - oc.getOutput().doubleValue();
        }     
    }
   
    double mean_error = sum / outputs.size();
    //logger.debug("The sum error is: "+mean_error);
    /*
     * Put mean error on the input nodes of the whole map
     */
    int num=0;
    Iterator<Concept> it = map.getConceptsIterator();
    while(it.hasNext()){
      Concept c = it.next();
     
        LearningConcept lc = null;
        if(c instanceof LearningConcept)
          lc = (LearningConcept) c;
       
View Full Code Here

    //printErrorFlag();
    int num_completed = set_nodes;
    while(num_completed < map.getNumLearningConcepts()){
      Iterator<Concept> it = map.getConceptsIterator();
      while(it.hasNext()){
        Concept c = it.next();
       
        if(c instanceof LearningConcept){
          LearningConcept lc = (LearningConcept) c;
          if(!lc.isErrorCalculated()){
           
View Full Code Here

     
      LearningWeightedConnection wconn = null;
      if(conn instanceof LearningWeightedConnection)
        wconn = (LearningWeightedConnection) conn;
     
      Concept cin = wconn.getFrom();
      LearningConcept lin = null;
      if(cin instanceof LearningConcept)
        lin = (LearningConcept) cin;
     
      if(!lin.isErrorCalculated()){
View Full Code Here

   */
  private void updateNetworkWeights(){
    //logger.debug("- Update weights...");
    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();
View Full Code Here

   * Same method of the super class resetting also the errors
   */
  public void resetConcepts() {
    Iterator<Concept> iter = concepts.values().iterator();
    while (iter.hasNext()) {
      Concept concept = iter.next();
      concept.setOutput(0.0);
      concept.setPrevOutput(0.0);
      concept.setPrevOutput(null);
      
      if(concept instanceof LearningConcept){
        LearningConcept lc = (LearningConcept) concept;
        lc.error = 0;
        lc.error_calculated = false;
View Full Code Here

   
    /* clone concepts */
    map.concepts = new TreeMap<String, Concept>();
    Iterator<String> it = this.concepts.keySet().iterator();
    while(it.hasNext()){
      Concept c = (Concept) this.concepts.get(it.next()).clone();
      map.addConcept(c);
    }
   
    /* clone connections */
    Iterator<FcmConnection> iter = this.getConnectionsIterator();
View Full Code Here

  }
 
  public void printErrorFlag() {
    Iterator<Concept> iter = concepts.values().iterator();
    while (iter.hasNext()) {
      Concept concept = iter.next();
      
      if(concept instanceof LearningConcept){
        LearningConcept lc = (LearningConcept) concept;
        System.out.println("  "+lc.getName()+": "+lc.isErrorCalculated());
      }
View Full Code Here

      Iterator<Entry<String, Double>> it = inputs.entrySet().iterator();
      while(it.hasNext()){

        Entry<String, Double> e =  it.next();
        //System.out.println(e.getKey());
        Concept c = map.getConcept(e.getKey());
        if(c==null)
          System.err.println("Error: Concept "+e.getKey()+" not found.");
       
        if(c instanceof LearningConcept){
         
          entry.addInput((LearningConcept)c, e.getValue());
          //System.out.println("Entry: "+entry);
        }
      }
     
      it = outputs.entrySet().iterator();
      while(it.hasNext()){
        Entry<String, Double> e =  it.next();
        Concept c = map.getConcept(e.getKey());
        if(c==null)
          System.err.println("Error: Concept "+e.getKey()+" not found.");
       
        if(c instanceof LearningConcept)
          entry.addOutput((LearningConcept)c, e.getValue());
View Full Code Here

  }

  void resetMap() {
    Iterator<Concept> iter = map.getConceptsIterator();
    while (iter.hasNext()) {
      Concept concept = iter.next();
      concept.setOutput(0.0);
      concept.setPrevOutput(null);
      concept.setFixedOutput(false);
    }
  }
View Full Code Here

TOP

Related Classes of trust.jfcm.Concept

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.