* 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;