Package statechum.analysis.learning.observers

Examples of statechum.analysis.learning.observers.RecordProgressDecorator


        {
          return new Pair<Integer,String>(evalData.graph.paths.tracePathPrefixClosed(question),null);
        }
      };
 
      RecordProgressDecorator recorder = null;
      java.io.FileOutputStream out = null;
      Configuration progressRecorderConfig = evalData.config.copy();progressRecorderConfig.setCompressLogs(false);
        out = new java.io.FileOutputStream("resources/tmp.xml");
        recorder = new RecordProgressDecorator(learner2,out,1,progressRecorderConfig,true);
      recorder.writeLearnerEvaluationData(evalData);
      learner2.setTopLevelListener(recorder);
      recorder.learnMachine(initial.plus, initial.minus);
    } catch (java.io.IOException e) {
      statechum.Helper.throwUnchecked("failure reading/writing log files", e);
    }
  }
View Full Code Here


          }
        };
      }
      sPlus = rpg.getExtraSequences(percent/10-1);sMinus = rpg.getAllSequences(percent/10-1);

      RecordProgressDecorator recorder = null;
      try {
        recorder = new RecordProgressDecorator(l.getLearner(),new java.io.FileOutputStream(getFileName(FileType.LOG)),1,config,true);
        //recorder.setCompressionMethod(ZipEntry.STORED);// no compression, for speed.
      } catch (IOException e) {
        statechum.Helper.throwUnchecked("could not open log file for writing", e);
      }
      Collection<List<String>> graphTestSet = graph.wmethod.getFullTestSet(1);
      recorder.writeLearnerEvaluationData(new ProgressDecorator.LearnerEvaluationConfiguration(graph,graphTestSet,config,null));
      l.getLearner().setTopLevelListener(recorder);

      LearnerGraph learned = learn(recorder,sMinus);
      PTA_computePrecisionRecall precRec = new PTA_computePrecisionRecall(learned);
      PTASequenceEngine engine = new PTA_FSMStructure(graph);
View Full Code Here

       RPNIBlueFringeVariability ourLearner = new RPNIBlueFringeVariability(learnerInitConfiguration,true,null,null);
       LearnerGraph automatonAfterInit = ourLearner.getLearner().init(engine,0,0);
       final Configuration shallowCopy = automatonAfterInit.config.copy();shallowCopy.setLearnerCloneGraph(false);
       LearnerGraph copyOfAutomaton = new LearnerGraph(shallowCopy);LearnerGraph.copyGraphs(automatonAfterInit, copyOfAutomaton);
       ourLearner.setInitPta(copyOfAutomaton);
       RecordProgressDecorator recorder = new RecordProgressDecorator(ourLearner.getLearner(),log,1,learnerInitConfiguration.config,true);
       learnerInitConfiguration.graph = smallPTA;learnerInitConfiguration.testSet = new LinkedList<List<statechum.Label>>();
    recorder.writeLearnerEvaluationData(learnerInitConfiguration);
    recorder.init(new LinkedList<List<Label>>(),new LinkedList<List<Label>>());
    recorder.close();
    log.close();// double-close in fact (should already been closed by recorder) but it does not really matter.
   }
View Full Code Here

            questionNumber.addAndGet(1);
            return new Pair<Integer,String>(graph.paths.tracePath(question),null);
          }
        };
      }
      RecordProgressDecorator recorder = null;
      try {
        recorder = new RecordProgressDecorator(l.getLearner(),new java.io.FileOutputStream(getFileName(FileType.LOG)),1,config,true);
      } catch (IOException e) {
        statechum.Helper.throwUnchecked("could not open log file for writing", e);
      }
      Collection<List<String>> graphTestSet = graph.wmethod.getFullTestSet(1);
      recorder.writeLearnerEvaluationData(new ProgressDecorator.LearnerEvaluationConfiguration(graph,graphTestSet,config,null));
      l.getLearner().setTopLevelListener(recorder);
      learnt = learn(recorder,sMinus);
      //learned = new LearnerGraph(config);
     
      PTASequenceEngine testSetEngine = new PTA_FSMStructure(graph);
View Full Code Here

        {
          return new Pair<Integer,String>(evalData.graph.paths.tracePathPrefixClosed(question),null);
        }
      };
 
      RecordProgressDecorator recorder = null;
      java.io.FileOutputStream out = null;
      Configuration progressRecorderConfig = evalData.config.copy();progressRecorderConfig.setCompressLogs(false);
      out = new java.io.FileOutputStream(GlobalConfiguration.getConfiguration().getProperty(G_PROPERTIES.TEMP)+File.separator+"tmp.xml");
        recorder = new RecordProgressDecorator(learner2,out,1,progressRecorderConfig,true);
      recorder.writeLearnerEvaluationData(evalData);
      learner2.setTopLevelListener(recorder);
      recorder.learnMachine(initial.plus, initial.minus);
      inputStream.close();
      out.close();
    } catch (java.io.IOException e) {
      statechum.Helper.throwUnchecked("failure reading/writing log files", e);
    }
View Full Code Here

        {
          return new Pair<Integer,String>(evalData.graph.paths.tracePath(question),null);
        }
      };
 
      RecordProgressDecorator recorder = null;
      java.io.FileOutputStream out = null;
      Configuration progressRecorderConfig = evalData.config.copy();progressRecorderConfig.setCompressLogs(false);
        out = new java.io.FileOutputStream("resources/tmp.xml");
        recorder = new RecordProgressDecorator(learner2,out,1,progressRecorderConfig,true);
      recorder.writeLearnerEvaluationData(evalData);
      learner2.setTopLevelListener(recorder);
      recorder.learnMachine(initial.plus, initial.minus);
    } catch (java.io.IOException e) {
      statechum.Helper.throwUnchecked("failure reading/writing log files", e);
    }
  }
View Full Code Here

        {
          return new Pair<Integer,String>(evalData.graph.paths.tracePathPrefixClosed(question),null);
        }
      };
 
      RecordProgressDecorator recorder = null;
      java.io.FileOutputStream out = null;
      Configuration progressRecorderConfig = evalData.config.copy();progressRecorderConfig.setCompressLogs(false);
        out = new java.io.FileOutputStream("resources/tmp.xml");
        recorder = new RecordProgressDecorator(learner2,out,1,progressRecorderConfig,true);
      recorder.writeLearnerEvaluationData(evalData);
      learner2.setTopLevelListener(recorder);
      recorder.learnMachine(initial.plus, initial.minus);
    } catch (java.io.IOException e) {
      statechum.Helper.throwUnchecked("failure reading/writing log files", e);
    }
  }
View Full Code Here

        {
          return new Pair<Integer,String>(evalData.graph.paths.tracePathPrefixClosed(question),null);
        }
      };
 
      RecordProgressDecorator recorder = null;
      java.io.FileOutputStream out = null;
      Configuration progressRecorderConfig = evalData.config.copy();progressRecorderConfig.setCompressLogs(false);
        out = new java.io.FileOutputStream("resources/tmp.xml");
        recorder = new RecordProgressDecorator(learner2,out,1,progressRecorderConfig,true);
      recorder.writeLearnerEvaluationData(evalData);
      learner2.setTopLevelListener(recorder);
      recorder.learnMachine(initial.plus, initial.minus);
      inputStream.close();
      out.close();
    } catch (java.io.IOException e) {
      statechum.Helper.throwUnchecked("failure reading/writing log files", e);
    }
View Full Code Here

       RPNIBlueFringeTestVariability ourLearner = new RPNIBlueFringeTestVariability(learnerInitConfiguration,true,null,null);
       LearnerGraph automatonAfterInit = ourLearner.getLearner().init(engine,0,0);
       final Configuration shallowCopy = automatonAfterInit.config.copy();shallowCopy.setLearnerCloneGraph(false);
       LearnerGraph copyOfAutomaton = new LearnerGraph(shallowCopy);LearnerGraph.copyGraphs(automatonAfterInit, copyOfAutomaton);
       ourLearner.setInitPta(copyOfAutomaton);
       RecordProgressDecorator recorder = new RecordProgressDecorator(ourLearner.getLearner(),log,1,learnerInitConfiguration.config,true);
       learnerInitConfiguration.graph = smallPTA;learnerInitConfiguration.testSet = new LinkedList<List<statechum.Label>>();
    recorder.writeLearnerEvaluationData(learnerInitConfiguration);
    recorder.init(new LinkedList<List<Label>>(),new LinkedList<List<Label>>());
    recorder.close();
    log.close();// double-close in fact (should already been closed by recorder) but it does not really matter.
   }
View Full Code Here

      PTASequenceSet plusPTA = new PTASequenceSet();plusPTA.addAll(sPlus);PTASequenceSet minusPTA = new PTASequenceSet();minusPTA.addAll(sMinus);


      changeParametersOnComputeStateScores(l.getScoreComputer());

      RecordProgressDecorator testDecorator = null;
      Configuration recordingConfig = Configuration.getDefaultConfiguration().copy();
      recordingConfig.setLearnerToUse(LEARNER.LEARNER_BLUEFRINGE_DEC2007);
      try {
        String logfileName = FileType.LOG.getFileName(outputDir+"_"+renumberSeed+File.separatorChar+instanceID+"_"+(new File(inputFileName).getName())+"_"+recordingConfig.getLearnerToUse(),"");
        testDecorator = new RecordProgressDecorator(l.getLearner(),new FileOutputStream(logfileName),1,recordingConfig,true);
        //testDecorator = new MatchProgressDecorator(l,new FileReader(getFileName(FileType.DATA)));
      } catch (IOException e) {
        IllegalArgumentException ex = new IllegalArgumentException("failed to construct recording decorator: "+e.getMessage());ex.initCause(e);
        throw ex;
      }
     
      Collection<List<String>> testSet = wm.getFullTestSet();
      testDecorator.writeLearnerEvaluationData(new LearnerEvaluationConfiguration(graph, testSet, recordingConfig,null));
      changeParametersOnLearner(l);
      learningOutcome = testDecorator.learnMachine(plusPTA, minusPTA.getData());
      l.setQuestionCounter(0);
      FSMStructure learned = WMethod.getGraphData(learningOutcome);

      PTA_computePrecisionRecall precRec = new PTA_computePrecisionRecall(learned);
      PTATestSequenceEngine engineTestSet = new PTA_FSMStructure(fsm);
View Full Code Here

TOP

Related Classes of statechum.analysis.learning.observers.RecordProgressDecorator

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.