Examples of StateBasedRandom


Examples of statechum.analysis.learning.linear.GDLearnerGraph.StateBasedRandom

    case SCORE_RANDOMPATHS:
    case SCORE_TESTSET:
      // build (1) deterministic machines for each state and (2) walks from each state.
      int seed = 80;
      JConsole_Diagnostics.getDiagnostics().setStatus("started on walk forward "+DateFormat.getTimeInstance().format(new Date()));
      forward.computeWalkSequences(new StateBasedRandom(seed), threads);
      JConsole_Diagnostics.getDiagnostics().setStatus("started on walk inverse "+DateFormat.getTimeInstance().format(new Date()));
      inverse.computeWalkSequences(new StateBasedRandom(seed), threads);
      ddrh = DDRH_BCR.class;
      break;
    case SCORE_LINEAR:
      ddrh = DDRH_default.class;
      break;
View Full Code Here

Examples of statechum.analysis.learning.linear.GDLearnerGraph.StateBasedRandom

    config.setGdScoreComputationAlgorithm_RandomWalk_ExtraLength(0);
    LearnerGraph gr=buildLearnerGraph(NDGraph, "testCount_computeGraphs", config);
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, true);
    //Visualiser.updateFrame(ndGraph.matrixInverse, null);
    //RandomPathGenerator.diameter(ndGraph.matrixInverse);
    ndGraph.computeWalkSequences(new StateBasedRandom(80), 1);
   
    Assert.assertNull(WMethod.checkM(buildLearnerGraph("A-a->BE-b->CFG-d->F-d->F / CFG-c->DH-f->D-f->D / DH-e->H-e->H","testCount_computeGraphs_A",config),
        ndGraph.stateToCorrespondingGraph.get(gr.findVertex(VertexID.parseID("A"))).graph));
    Assert.assertNull(WMethod.checkM(buildLearnerGraph("B-b->C-c->D-f->D","testCount_computeGraphs_B",config),
        ndGraph.stateToCorrespondingGraph.get(gr.findVertex(VertexID.parseID("B"))).graph));
View Full Code Here

Examples of statechum.analysis.learning.linear.GDLearnerGraph.StateBasedRandom

    config.setGdScoreComputationAlgorithm_RandomWalk_NumberOfSequences(200);
    config.setGdScoreComputationAlgorithm_RandomWalk_ExtraLength(0);
    config.setGdScoreComputationAlgorithm_RandomWalk_PathLength(4);
    LearnerGraph gr=buildLearnerGraph(NDGraph, "testCount_computeGraphs", config);
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, true);
    ndGraph.computeWalkSequences(new StateBasedRandom(80), 1);
   
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_BCR();
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"C","D");
    Assert.assertEquals(4.76190476190,matcher.getRightHandSide(),Configuration.fpAccuracy);
    Assert.assertEquals(2*2,matcher.getDiagonal(),Configuration.fpAccuracy);
 
View Full Code Here

Examples of statechum.analysis.learning.linear.GDLearnerGraph.StateBasedRandom

  {
    Configuration config = Configuration.getDefaultConfiguration().copy();
    config.setGdScoreComputationAlgorithm(GDScoreComputationAlgorithmEnum.SCORE_TESTSET);
    LearnerGraph gr=buildLearnerGraph(NDGraph, "testCount_computeGraphs", config);
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, true);
    ndGraph.computeWalkSequences(new StateBasedRandom(80), 1);
   
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_BCR();
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"C","D");
    Assert.assertEquals(100./3.,matcher.getRightHandSide(),Configuration.fpAccuracy);
    Assert.assertEquals(2*2,matcher.getDiagonal(),Configuration.fpAccuracy);
 
View Full Code Here

Examples of statechum.analysis.learning.linear.GDLearnerGraph.StateBasedRandom

    case SCORE_RANDOMPATHS:
    case SCORE_TESTSET:
      // build (1) deterministic machines for each state and (2) walks from each state.
      int seed = 80;
      JConsole_Diagnostics.getDiagnostics().setStatus("started on walk forward "+DateFormat.getTimeInstance().format(new Date()));
      forward.computeWalkSequences(new StateBasedRandom(seed), threads);
      JConsole_Diagnostics.getDiagnostics().setStatus("started on walk inverse "+DateFormat.getTimeInstance().format(new Date()));
      inverse.computeWalkSequences(new StateBasedRandom(seed), threads);
      ddrh = DDRH_BCR.class;
      break;
    case SCORE_LINEAR:
      ddrh = DDRH_default.class;
      break;
View Full Code Here

Examples of statechum.analysis.learning.linear.GDLearnerGraph.StateBasedRandom

    writeMatrix(gr, "cvsExample.csv");
  }
 
 
  public static void writeMatrix(LearnerGraph gr, String name){
    Stack<PairScore> pairScores = gr.pairscores.chooseStatePairs(GDLearnerGraph.PAIR_INCOMPATIBLE*2,10,1,null,LearnerGraphND.ignoreNone, new StateBasedRandom(1));
    ArrayList<StringVertex> vertexList = new ArrayList<StringVertex>();
    DirectedSparseGraph dsg = gr.pathroutines.getGraph();
    vertexList.addAll(dsg.getVertices());
    writeMatrix(pairScores,vertexList,vertexList, name);
  }
View Full Code Here

Examples of statechum.analysis.learning.linear.GDLearnerGraph.StateBasedRandom

    case SCORE_RANDOMPATHS:
    case SCORE_TESTSET:
      // build (1) deterministic machines for each state and (2) walks from each state.
      int seed = 80;
      JConsole_Diagnostics.getDiagnostics().setStatus("started on walk forward "+DateFormat.getTimeInstance().format(new Date()));
      forward.computeWalkSequences(new StateBasedRandom(seed), threads);
      JConsole_Diagnostics.getDiagnostics().setStatus("started on walk inverse "+DateFormat.getTimeInstance().format(new Date()));
      inverse.computeWalkSequences(new StateBasedRandom(seed), threads);
      ddrh = DDRH_BCR.class;
      break;
    case SCORE_LINEAR:
      ddrh = DDRH_default.class;
      break;
View Full Code Here

Examples of statechum.analysis.learning.linear.GDLearnerGraph.StateBasedRandom

    config.setGdScoreComputationAlgorithm_RandomWalk_ExtraLength(0);
    LearnerGraph gr=buildLearnerGraph(NDGraph, "testCount_computeGraphs", config,converter);
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, true);
    //Visualiser.updateFrame(ndGraph.matrixInverse, null);
    //RandomPathGenerator.diameter(ndGraph.matrixInverse);
    ndGraph.computeWalkSequences(new StateBasedRandom(80), 1);
   
    Assert.assertNull(WMethod.checkM(buildLearnerGraph("A-a->BE-b->CFG-d->F-d->F / CFG-c->DH-f->D-f->D / DH-e->H-e->H","testCount_computeGraphs_A",config,converter),
        ndGraph.stateToCorrespondingGraph.get(gr.findVertex(VertexID.parseID("A"))).graph));
    Assert.assertNull(WMethod.checkM(buildLearnerGraph("B-b->C-c->D-f->D","testCount_computeGraphs_B",config,converter),
        ndGraph.stateToCorrespondingGraph.get(gr.findVertex(VertexID.parseID("B"))).graph));
View Full Code Here

Examples of statechum.analysis.learning.linear.GDLearnerGraph.StateBasedRandom

    config.setGdScoreComputationAlgorithm_RandomWalk_NumberOfSequences(200);
    config.setGdScoreComputationAlgorithm_RandomWalk_ExtraLength(0);
    config.setGdScoreComputationAlgorithm_RandomWalk_PathLength(4);
    LearnerGraph gr=buildLearnerGraph(NDGraph, "testCount_computeGraphs", config,converter);
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, true);
    ndGraph.computeWalkSequences(new StateBasedRandom(80), 1);
   
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_BCR();
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"C","D");
    Assert.assertEquals(4.76190476190,matcher.getRightHandSide(),Configuration.fpAccuracy);
    Assert.assertEquals(2*2,matcher.getDiagonal(),Configuration.fpAccuracy);
 
View Full Code Here

Examples of statechum.analysis.learning.linear.GDLearnerGraph.StateBasedRandom

  {
    Configuration config = configMain.copy();
    config.setGdScoreComputationAlgorithm(GDScoreComputationAlgorithmEnum.SCORE_TESTSET);
    LearnerGraph gr=buildLearnerGraph(NDGraph, "testCount_computeGraphs", config,converter);
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, true);
    ndGraph.computeWalkSequences(new StateBasedRandom(80), 1);
   
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_BCR();
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"C","D");
    Assert.assertEquals(100./3.,matcher.getRightHandSide(),Configuration.fpAccuracy);
    Assert.assertEquals(2*2,matcher.getDiagonal(),Configuration.fpAccuracy);
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.