Package statechum.analysis.learning.experiments.PairSelection.PairQualityLearner

Examples of statechum.analysis.learning.experiments.PairSelection.PairQualityLearner.InitialConfigurationAndData


  {
    final Configuration learnerConfig = Configuration.getDefaultConfiguration().copy();learnerConfig.setGeneralisationThreshold(0);learnerConfig.setGdFailOnDuplicateNames(false);
        learnerConfig.setGdLowToHighRatio(0.75);learnerConfig.setGdKeyPairThreshold(0.5);learnerConfig.setTransitionMatrixImplType(STATETREE.STATETREE_ARRAY);
        learnerConfig.setAskQuestions(false);
       
       final InitialConfigurationAndData initialConfigAndData = PairQualityLearner.loadInitialAndPopulateInitialConfiguration(PairQualityLearner.largePTAFileName, learnerConfig, new Transform.InternStringLabel());

    LearnerGraph referenceGraph = new LearnerGraph(initialConfigAndData.initial.graph.config);AbstractPersistence.loadGraph("resources/largePTA/outcome_correct", referenceGraph, initialConfigAndData.learnerInitConfiguration.getLabelConverter());
      WekaDataCollector dataCollector = PairQualityLearner.createDataCollector(ifDepth);
      LearnerThatCanClassifyPairs learnerOfPairs = new PairQualityLearner.LearnerThatUpdatesWekaResults(initialConfigAndData.learnerInitConfiguration,referenceGraph,dataCollector,initialConfigAndData.initial.graph);
    learnerOfPairs.learnMachine(new LinkedList<List<Label>>(),new LinkedList<List<Label>>());
View Full Code Here


  @Test
  public void testMergerOnLargePTA() throws IOException
  {
    Configuration configToLoadWith = mainConfiguration.copy();configToLoadWith.setTransitionMatrixImplType(STATETREE.STATETREE_ARRAY);
    ConvertALabel labelConverter = converter;if (labelConverter == null) labelConverter = new Transform.InternStringLabel();
    InitialConfigurationAndData initialConfigurationData = PairQualityLearner.loadInitialAndPopulateInitialConfiguration(PairQualityLearner.veryLargePTAFileName, configToLoadWith, labelConverter);
    LearnerGraph hugeGraph = new LearnerGraph(initialConfigurationData.initial.graph,mainConfiguration);LearnerGraph smallGraph = new LearnerGraph(initialConfigurationData.learnerInitConfiguration.graph,mainConfiguration);
   
    System.out.println("Huge: "+hugeGraph.getStateNumber()+" states, "+(hugeGraph.getStateNumber()-hugeGraph.getAcceptStateNumber())+" reject states");
    System.out.println("Small: "+smallGraph.getStateNumber()+" states, "+(smallGraph.getStateNumber()-smallGraph.getAcceptStateNumber())+" reject states");
    Label labelToMerge = AbstractLearnerGraph.generateNewLabel("Waypoint_Selected",mainConfiguration,converter);
View Full Code Here

  @Test
  public void recordPairs() throws IOException
  {
    Configuration config = Configuration.getDefaultConfiguration().copy();config.setTransitionMatrixImplType(Configuration.STATETREE.STATETREE_LINKEDHASH);
    Transform.InternStringLabel converter = new Transform.InternStringLabel();
    InitialConfigurationAndData initialConfigAndData = PairQualityLearner.loadInitialAndPopulateInitialConfiguration(PairQualityLearner.largePTAFileName, config, converter);
    for(boolean merger:new Boolean[]{true,false})
    {
      List<PairOfPaths> listOfPairs = new java.util.ArrayList<PairOfPaths>(1000);
          long tmStarted = new Date().getTime();
          new RPNIBlueFringeVariability(initialConfigAndData.learnerInitConfiguration,merger,listOfPairs,null).learn(initialConfigAndData.initial.graph);
View Full Code Here

  @Test
  public void testMergerOnLargePTA() throws IOException
  {
    Configuration configToLoadWith = mainConfiguration.copy();configToLoadWith.setTransitionMatrixImplType(STATETREE.STATETREE_ARRAY);
    ConvertALabel labelConverter = converter;if (labelConverter == null) labelConverter = new Transform.InternStringLabel();
    InitialConfigurationAndData initialConfigurationData = PairQualityLearner.loadInitialAndPopulateInitialConfiguration(PairQualityLearner.veryLargePTAFileName, configToLoadWith, labelConverter);
    LearnerGraph hugeGraph = new LearnerGraph(initialConfigurationData.initial.graph,mainConfiguration);LearnerGraph smallGraph = new LearnerGraph(initialConfigurationData.learnerInitConfiguration.graph,mainConfiguration);
   
    System.out.println("Huge: "+hugeGraph.getStateNumber()+" states, "+(hugeGraph.getStateNumber()-hugeGraph.getAcceptStateNumber())+" reject states");
    System.out.println("Small: "+smallGraph.getStateNumber()+" states, "+(smallGraph.getStateNumber()-smallGraph.getAcceptStateNumber())+" reject states");
    Label labelToMerge = AbstractLearnerGraph.generateNewLabel("Waypoint_Selected",mainConfiguration,converter);
View Full Code Here

 
  @Test
  public void runCompareTwoLearners() throws IOException
    {
    Transform.InternStringLabel converter = new Transform.InternStringLabel();Configuration learnerConf = Configuration.getDefaultConfiguration().copy();
    InitialConfigurationAndData initialConfigurationData = PairQualityLearner.loadInitialAndPopulateInitialConfiguration(PairQualityLearner.largePTAFileName, learnerConf, converter);
    initialConfigurationData.learnerInitConfiguration.config.setTransitionMatrixImplType(matrixToUse);// set the expected matrix type
    LearnerGraph hugeGraph = new LearnerGraph(initialConfigurationData.initial.graph,initialConfigurationData.learnerInitConfiguration.config);// change the transition matrix type of the graph
        FileReader listOptReader = new FileReader(PairQualityLearner.largePTALogsDir+pairsToUse);
        List<PairOfPaths> listOpt=PairOfPaths.readPairs(listOptReader, learnerConf,converter);
        listOptReader.close();
View Full Code Here

  {
    final Configuration learnerConfig = Configuration.getDefaultConfiguration().copy();learnerConfig.setGeneralisationThreshold(0);learnerConfig.setGdFailOnDuplicateNames(false);
        learnerConfig.setGdLowToHighRatio(0.75);learnerConfig.setGdKeyPairThreshold(0.5);learnerConfig.setTransitionMatrixImplType(STATETREE.STATETREE_ARRAY);
        learnerConfig.setAskQuestions(false);
       
       final InitialConfigurationAndData initialConfigAndData = PairQualityLearner.loadInitialAndPopulateInitialConfiguration(PairQualityLearner.largePTAFileName, learnerConfig, new Transform.InternStringLabel());

    LearnerGraph referenceGraph = new LearnerGraph(initialConfigAndData.initial.graph.config);AbstractPersistence.loadGraph("resources/largePTA/outcome_correct", referenceGraph, initialConfigAndData.learnerInitConfiguration.getLabelConverter());
      WekaDataCollector dataCollector = PairQualityLearner.createDataCollector(ifDepth);
      LearnerThatCanClassifyPairs learnerOfPairs = new PairQualityLearner.LearnerThatUpdatesWekaResults(initialConfigAndData.learnerInitConfiguration,referenceGraph,dataCollector,initialConfigAndData.initial.graph);
    learnerOfPairs.learnMachine(new LinkedList<List<Label>>(),new LinkedList<List<Label>>());
View Full Code Here

 
  @Test
  public void runCompareTwoLearners() throws IOException
    {
    Transform.InternStringLabel converter = new Transform.InternStringLabel();Configuration learnerConf = Configuration.getDefaultConfiguration().copy();
    InitialConfigurationAndData initialConfigurationData = PairQualityLearner.loadInitialAndPopulateInitialConfiguration(PairQualityLearner.largePTAFileName, learnerConf, converter);
    initialConfigurationData.learnerInitConfiguration.config.setTransitionMatrixImplType(matrixToUse);// set the expected matrix type
    LearnerGraph hugeGraph = new LearnerGraph(initialConfigurationData.initial.graph,initialConfigurationData.learnerInitConfiguration.config);// change the transition matrix type of the graph
        FileReader listOptReader = new FileReader(PairQualityLearner.largePTALogsDir+pairsToUse);
        List<PairOfPaths> listOpt=PairOfPaths.readPairs(listOptReader, learnerConf,converter);
        listOptReader.close();
View Full Code Here

  @Test
  public void recordPairs() throws IOException
  {
    Configuration config = Configuration.getDefaultConfiguration().copy();config.setTransitionMatrixImplType(Configuration.STATETREE.STATETREE_LINKEDHASH);
    Transform.InternStringLabel converter = new Transform.InternStringLabel();
    InitialConfigurationAndData initialConfigAndData = PairQualityLearner.loadInitialAndPopulateInitialConfiguration(PairQualityLearner.largePTAFileName, config, converter);
    for(boolean merger:new Boolean[]{true,false})
    {
      List<PairOfPaths> listOfPairs = new java.util.ArrayList<PairOfPaths>(1000);
          long tmStarted = new Date().getTime();
          new TestLearnerFromLargePTA.RPNIBlueFringeTestVariability(initialConfigAndData.learnerInitConfiguration,merger,listOfPairs,null).learn(initialConfigAndData.initial.graph);
View Full Code Here

  {
    final Configuration learnerConfig = Configuration.getDefaultConfiguration().copy();learnerConfig.setGeneralisationThreshold(0);learnerConfig.setGdFailOnDuplicateNames(false);
        learnerConfig.setGdLowToHighRatio(0.75);learnerConfig.setGdKeyPairThreshold(0.5);learnerConfig.setTransitionMatrixImplType(STATETREE.STATETREE_ARRAY);
        learnerConfig.setAskQuestions(false);
       
       final InitialConfigurationAndData initialConfigAndData = PairQualityLearner.loadInitialAndPopulateInitialConfiguration(PairQualityLearner.largePTAFileName, learnerConfig, new Transform.InternStringLabel());

    LearnerGraph referenceGraph = new LearnerGraph(initialConfigAndData.initial.graph.config);AbstractPersistence.loadGraph("resources/largePTA/outcome_correct", referenceGraph, initialConfigAndData.learnerInitConfiguration.getLabelConverter());
      WekaDataCollector dataCollector = PairQualityLearner.createDataCollector(ifDepth);
      LearnerThatCanClassifyPairs learnerOfPairs = new PairQualityLearner.LearnerThatUpdatesWekaResults(initialConfigAndData.learnerInitConfiguration,referenceGraph,dataCollector,initialConfigAndData.initial.graph);
    learnerOfPairs.learnMachine(new LinkedList<List<Label>>(),new LinkedList<List<Label>>());
View Full Code Here

TOP

Related Classes of statechum.analysis.learning.experiments.PairSelection.PairQualityLearner.InitialConfigurationAndData

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.