Examples of generateRandomPosNeg()


Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.generateRandomPosNeg()

    assert origAlphabet.equals(markov.pathroutines.computeAlphabet());
    assert origAlphabet.equals(markovD.pathroutines.computeAlphabet());
    assert origAlphabet.equals(edsm.pathroutines.computeAlphabet());
    final RandomPathGenerator generator = new RandomPathGenerator(cvsGraph,new Random(0),5,null);
    final int posOrNegPerChunk = 50;
    generator.generateRandomPosNeg(posOrNegPerChunk*2,1);
    Collection<List<String>> sequences = cvsGraph.wmethod.getFullTestSet(1);//generator.getAllSequences(0).getData(PTASequenceEngine.truePred);

    PTASequenceEngine walkEngine = new PTA_FSMStructure(cvsGraph,null);
    SequenceSet ptaWalk = walkEngine.new SequenceSet();ptaWalk.setIdentity();
    ptaWalk = ptaWalk.cross(sequences);
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.generateRandomPosNeg()

              RandomPathGenerator randomPaths = new RandomPathGenerator(deterministicGraph,randomGenerator.getRandom(entryA.getKey()),
                  extraLength+config.getGdScoreComputationAlgorithm_RandomWalk_ExtraLength(),state,matrixForward.pathroutines.computeAlphabet());
              if (config.getGdScoreComputationAlgorithm_RandomWalk_PathLength() > 0)
                randomPaths.setPathLength(config.getGdScoreComputationAlgorithm_RandomWalk_PathLength());
              randomPaths.generateRandomPosNeg(config.getGdScoreComputationAlgorithm_RandomWalk_NumberOfSequences(), 1,false);
              graphwalk=new GraphAndWalk(deterministicGraph,randomPaths.getAllSequences(0));
            }
            break;
          case SCORE_TESTSET:
            graphwalk=new GraphAndWalk(deterministicGraph,deterministicGraph.wmethod.computeNewTestSet(state, config.getGdScoreComputationAlgorithm_TestSet_ExtraStates()));
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.generateRandomPosNeg()

      for(int attempt=0;attempt<2;++attempt)
      {// try learning the same machine a few times
        LearnerGraph pta = new LearnerGraph(config);
        RandomPathGenerator generator = new RandomPathGenerator(referenceGraph,new Random(attempt),5,null);
        final int tracesToGenerate = makeEven(traceQuantity);
        generator.generateRandomPosNeg(tracesToGenerate, 1, false, new RandomLengthGenerator() {
                   
            @Override
            public int getLength() {
              return (int)(traceLengthMultiplier*states*tracesAlphabet);
            }
 
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.generateRandomPosNeg()

      for(int attempt=0;attempt<2;++attempt)
      {// try learning the same machine a few times
        LearnerGraph pta = new LearnerGraph(config);
        RandomPathGenerator generator = new RandomPathGenerator(referenceGraph,new Random(attempt),5,null);
        final int tracesToGenerate = makeEven(traceQuantity);
        generator.generateRandomPosNeg(tracesToGenerate, 1, false, new RandomLengthGenerator() {
                   
            @Override
            public int getLength() {
              return (int)(traceLengthMultiplier*states*tracesAlphabet);
            }
 
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.generateRandomPosNeg()

      for(int attempt=0;attempt<2;++attempt)
      {// try learning the same machine a few times
        LearnerGraph pta = new LearnerGraph(config);
        RandomPathGenerator generator = new RandomPathGenerator(referenceGraph,new Random(attempt),5,null);
        final int tracesToGenerate = makeEven(traceQuantity);
        generator.generateRandomPosNeg(tracesToGenerate, 1, false, new RandomLengthGenerator() {
                   
            @Override
            public int getLength() {
              return (int)(traceLengthMultiplier*states*alphabet);
            }
 
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.generateRandomPosNeg()

      for(int attempt=0;attempt<2;++attempt)
      {// try learning the same machine a few times
        LearnerGraph pta = new LearnerGraph(config);
        RandomPathGenerator generator = new RandomPathGenerator(referenceGraph,new Random(attempt),5,null);
        final int tracesToGenerate = makeEven(traceQuantity);
        generator.generateRandomPosNeg(tracesToGenerate, 1, false, new RandomLengthGenerator() {
                   
            @Override
            public int getLength() {
              return (int)(traceLengthMultiplier*states*tracesAlphabet);
            }
 
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.generateRandomPosNeg()

      for(int attempt=0;attempt<2;++attempt)
      {// try learning the same machine a few times
        LearnerGraph pta = new LearnerGraph(config);
        RandomPathGenerator generator = new RandomPathGenerator(referenceGraph,new Random(attempt),5,null);
        final int tracesToGenerate = makeEven(traceQuantity);
        generator.generateRandomPosNeg(tracesToGenerate, 1, false, new RandomLengthGenerator() {
                   
            @Override
            public int getLength() {
              return (int)(traceLengthMultiplier*states*alphabet);
            }
 
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.generateRandomPosNeg()

      // For the purpose of generating long traces, we construct as many traces as there are states but these traces have to be rather long,
      // that is, length of traces will be (random(pathLength)+1)*sequencesPerChunk/states and the number of traces generated will be the same as the number of states.
      final int tracesToGenerate = 20;//PairQualityLearner.makeEven(states*traceQuantity*3);
      final Random rnd = new Random(seed*31+attempt);
     
      generator.generateRandomPosNeg(tracesToGenerate, 1, false, new RandomLengthGenerator() {
                 
          @Override
          public int getLength() {
            return  6;//10*(rnd.nextInt(pathLength)+1)*sequencesPerChunk/tracesToGenerate;
          }
 
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.generateRandomPosNeg()

              RandomPathGenerator randomPaths = new RandomPathGenerator(deterministicGraph,randomGenerator.getRandom(entryA.getKey()),
                  extraLength+config.getGdScoreComputationAlgorithm_RandomWalk_ExtraLength(),state,matrixForward.pathroutines.computeAlphabet());
              if (config.getGdScoreComputationAlgorithm_RandomWalk_PathLength() > 0)
                randomPaths.setPathLength(config.getGdScoreComputationAlgorithm_RandomWalk_PathLength());
              randomPaths.generateRandomPosNeg(config.getGdScoreComputationAlgorithm_RandomWalk_NumberOfSequences(), 1,false);
              graphwalk=new GraphAndWalk(deterministicGraph,randomPaths.getAllSequences(0));
            }
            break;
          case SCORE_TESTSET:
            graphwalk=new GraphAndWalk(deterministicGraph,deterministicGraph.wmethod.computeNewTestSet(state, config.getGdScoreComputationAlgorithm_TestSet_ExtraStates()));
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.generateRandomPosNeg()

     for(CmpVertex vert:referenceGraph.transitionMatrix.keySet())
       if (!vert.isAccept())
         throw new IllegalArgumentException("test set generation should not be attempted on an automaton with reject-states");
     assert numberOfSeq > 0 && seqLength > 0;
    RandomPathGenerator pathGen = new RandomPathGenerator(referenceGraph,new Random(0),seqLength,referenceGraph.getInit());
    pathGen.generateRandomPosNeg(numberOfSeq, 1, false, null, true,true,null,null);
    return  pathGen.getAllSequences(0).getData(PTASequenceEngine.truePred);
     /*
    Collection<List<Label>> evaluationTestSet = referenceGraph.wmethod.getFullTestSet(1);
   
    RandomPathGenerator pathGen = new RandomPathGenerator(referenceGraph,new Random(0),5,referenceGraph.getInit());
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.