Package statechum.analysis.learning.MarkovClassifier

Examples of statechum.analysis.learning.MarkovClassifier.ConsistencyChecker


        final Configuration deepCopy = pta.config.copy();deepCopy.setLearnerCloneGraph(true);
        LearnerGraph ptaCopy = new LearnerGraph(deepCopy);LearnerGraph.copyGraphs(pta, ptaCopy);

        // now use pathsToMerge to compute which states can/cannot be merged together.
        LearnerGraph trimmedReference = trimUncoveredTransitions(pta,referenceGraph);
        final ConsistencyChecker checker = new MarkovClassifier.DifferentPredictionsInconsistencyNoBlacklisting();
        //long inconsistencyForTheReferenceGraph = MarkovClassifier.computeInconsistency(trimmedReference, m, checker,false);
        //System.out.println("Inconsistency of trimmed reference : "+inconsistencyForTheReferenceGraph);
       
        //if (inconsistencyForTheReferenceGraph != 53)
        //  break;// ignore automata where we get good results.
View Full Code Here


  {
    List<StatePair> pairsList = ptaClassifier.buildVerticesToMergeForPath(pathsOfInterest);
    LinkedList<AMEquivalenceClass<CmpVertex,LearnerGraphCachedData>> verticesToMerge = new LinkedList<AMEquivalenceClass<CmpVertex,LearnerGraphCachedData>>();
    ptaClassifier.graph.pairscores.computePairCompatibilityScore_general(null, pairsList, verticesToMerge);
    LearnerGraph merged = MergeStates.mergeCollectionOfVertices(ptaClassifier.graph, null, verticesToMerge);// after merging all paths of interest, we get this graph.
    ConsistencyChecker checker = new MarkovClassifier.DifferentPredictionsInconsistency();
    final long genScoreThreshold = 1;
    int nrOfMergers=0;
    List<StatePair> pairsToMerge = new LinkedList<StatePair>();
    for(Entry<CmpVertex,Map<Label,CmpVertex>> entry:merged.transitionMatrix.entrySet())
      for(Entry<Label,CmpVertex> transition:entry.getValue().entrySet())
View Full Code Here

    LinkedList<AMEquivalenceClass<CmpVertex,LearnerGraphCachedData>> verticesToMerge = new LinkedList<AMEquivalenceClass<CmpVertex,LearnerGraphCachedData>>();
    int genScore = ptaClassifier.graph.pairscores.computePairCompatibilityScore_general(null, constructPairsToMergeBasedOnSetsToMerge(ptaClassifier.graph.transitionMatrix.keySet(),verticesToMergeBasedOnInitialPTA), verticesToMerge);
    LearnerGraph graph = MergeStates.mergeCollectionOfVertices(ptaClassifier.graph, null, verticesToMerge);
   
    Set<CmpVertex> tr=graph.transform.trimGraph(10, graph.getInit()).transitionMatrix.keySet();
    ConsistencyChecker checker = new MarkovClassifier.DifferentPredictionsInconsistency();

    constructPairsToMergeBasedOnSetsToMerge(graph.transitionMatrix.keySet(),verticesToMergeBasedOnInitialPTA);   
    for(CmpVertex v0:tr)
      for(CmpVertex v1:tr)
        if (v0 != v1)
View Full Code Here

        final Configuration deepCopy = pta.config.copy();deepCopy.setLearnerCloneGraph(true);
        LearnerGraph ptaCopy = new LearnerGraph(deepCopy);LearnerGraph.copyGraphs(pta, ptaCopy);

        LearnerGraph trimmedReference = MarkovPassivePairSelection.trimUncoveredTransitions(pta,referenceGraph);
       
        final ConsistencyChecker checker = new MarkovClassifier.DifferentPredictionsInconsistencyNoBlacklisting();
        long inconsistencyForTheReferenceGraph = MarkovClassifier.computeInconsistency(referenceGraph, m, checker,false);
       
        learnerOfPairs = new LearnerMarkovPassive(learnerEval,referenceGraph,pta);learnerOfPairs.setMarkovModel(m);

        learnerOfPairs.setScoreComputationOverride(new statechum.analysis.learning.rpnicore.PairScoreComputation.RedNodeSelectionProcedure() {
View Full Code Here

                            for(List<Label> seq:sMinus)
                              pta.paths.augmentPTA(seq,false,false,null);
                            final MarkovModel m= new MarkovModel(3,true,true,false);

                            new MarkovClassifier(m, pta).updateMarkov(false);// construct Markov chain if asked for.
                            final ConsistencyChecker checker = new MarkovClassifier.DifferentPredictionsInconsistencyNoBlacklistingIncludeMissingPrefixes();
                         
                            pta.clearColours();
                            EDSM_MarkovLearner learner = new EDSM_MarkovLearner(learnerInitConfiguration,pta,0) {

                              @Override
View Full Code Here

    // transitions in the vicinity of the added ones. For instance, where a path has been folded in with some transitions sticking out, those new ones
    // may be inconsistent with predictions, based on the transitions in the red part of the graph.

    // mapping map to store all paths leave each state in different length
    double tentativeScore=0;
    @SuppressWarnings("rawtypes")
    ConsistencyChecker checker = new MarkovClassifier.InconsistencyNullVsPredicted();
    MarkovClassifier resultClassifier = new MarkovClassifier(cl.model,result);
    for(Entry<CmpVertex,Collection<Label>> entry:labelsAdded.entrySet())
      if (!entry.getValue().isEmpty())
      {
View Full Code Here

  {
    List<StatePair> pairsList = ptaClassifier.buildVerticesToMergeForPath(pathsOfInterest);
    LinkedList<AMEquivalenceClass<CmpVertex,LearnerGraphCachedData>> verticesToMerge = new LinkedList<AMEquivalenceClass<CmpVertex,LearnerGraphCachedData>>();
    ptaClassifier.graph.pairscores.computePairCompatibilityScore_general(null, pairsList, verticesToMerge);
    LearnerGraph merged = MergeStates.mergeCollectionOfVertices(ptaClassifier.graph, null, verticesToMerge);// after merging all paths of interest, we get this graph.
    ConsistencyChecker checker = new MarkovClassifier.DifferentPredictionsInconsistency();
    final long genScoreThreshold = 1;
    int nrOfMergers=0;
    List<StatePair> pairsToMerge = new LinkedList<StatePair>();
    for(Entry<CmpVertex,Map<Label,CmpVertex>> entry:merged.transitionMatrix.entrySet())
      for(Entry<Label,CmpVertex> transition:entry.getValue().entrySet())
View Full Code Here

    LinkedList<AMEquivalenceClass<CmpVertex,LearnerGraphCachedData>> verticesToMerge = new LinkedList<AMEquivalenceClass<CmpVertex,LearnerGraphCachedData>>();
    int genScore = ptaClassifier.graph.pairscores.computePairCompatibilityScore_general(null, constructPairsToMergeBasedOnSetsToMerge(ptaClassifier.graph.transitionMatrix.keySet(),verticesToMergeBasedOnInitialPTA), verticesToMerge);
    LearnerGraph graph = MergeStates.mergeCollectionOfVertices(ptaClassifier.graph, null, verticesToMerge);
   
    Set<CmpVertex> tr=graph.transform.trimGraph(10, graph.getInit()).transitionMatrix.keySet();
    ConsistencyChecker checker = new MarkovClassifier.DifferentPredictionsInconsistency();

    constructPairsToMergeBasedOnSetsToMerge(graph.transitionMatrix.keySet(),verticesToMergeBasedOnInitialPTA);   
    for(CmpVertex v0:tr)
      for(CmpVertex v1:tr)
        if (v0 != v1)
View Full Code Here

        final Configuration deepCopy = pta.config.copy();deepCopy.setLearnerCloneGraph(true);
        LearnerGraph ptaCopy = new LearnerGraph(deepCopy);LearnerGraph.copyGraphs(pta, ptaCopy);

        // now use pathsToMerge to compute which states can/cannot be merged together.
        LearnerGraph trimmedReference = trimUncoveredTransitions(pta,referenceGraph);
        final ConsistencyChecker checker = new MarkovClassifier.DifferentPredictionsInconsistencyNoBlacklisting();
        //long inconsistencyForTheReferenceGraph = MarkovClassifier.computeInconsistency(trimmedReference, m, checker,false);
        //System.out.println("Inconsistency of trimmed reference : "+inconsistencyForTheReferenceGraph);
       
        //if (inconsistencyForTheReferenceGraph != 53)
        //  break;// ignore automata where we get good results.
View Full Code Here

    // transitions in the vicinity of the added ones. For instance, where a path has been folded in with some transitions sticking out, those new ones
    // may be inconsistent with predictions, based on the transitions in the red part of the graph.

    // mapping map to store all paths leave each state in different length
    double tentativeScore=0;
    @SuppressWarnings("rawtypes")
    ConsistencyChecker checker = new MarkovClassifier.InconsistencyNullVsPredicted();
    MarkovClassifier resultClassifier = new MarkovClassifier(cl.model,result);
    for(Entry<CmpVertex,Collection<Label>> entry:labelsAdded.entrySet())
      if (!entry.getValue().isEmpty())
      {
View Full Code Here

TOP

Related Classes of statechum.analysis.learning.MarkovClassifier.ConsistencyChecker

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.