Package statechum.analysis.learning.rpnicore

Examples of statechum.analysis.learning.rpnicore.AbstractLearnerGraph


  public void predictTransitionsAndUpdateMarkov(LearnerGraph tentativeAutomaton, boolean predictForward, boolean onlyLongest)
  {
    final Configuration shallowCopy = tentativeAutomaton.config.copy();shallowCopy.setLearnerCloneGraph(false);
    Set<Label> alphabet = tentativeAutomaton.learnerCache.getAlphabet();
    Map<Trace, MarkovOutcome> MarkovMatrix = getMarkov(predictForward);
    @SuppressWarnings("rawtypes")
    AbstractLearnerGraph Inverse_Graph = computeInverseGraph(tentativeAutomaton, predictForward);
      for(CmpVertex vert:tentativeAutomaton.transitionMatrix.keySet())
        for(int len=onlyLongest?chunk_Length:1;len <=chunk_Length;++len)// this is very inefficient; we'll optimize it later if needed.
             if(vert.isAccept())
              predictTransitionsFromStateAndUpdateMarkov(tentativeAutomaton,MarkovMatrix,Inverse_Graph,predictForward,vert,alphabet,len);
View Full Code Here


   * @return either an inverse or the original graph
   */
  @SuppressWarnings("rawtypes")
  public static AbstractLearnerGraph computeInverseGraph(LearnerGraph graph,boolean predictForward)
  {
    AbstractLearnerGraph Inverse_Graph = null;
    if (predictForward)
    {
      Configuration shallowCopy = graph.config.copy();shallowCopy.setLearnerCloneGraph(false);
      LearnerGraphND Inverse = new LearnerGraphND(shallowCopy);
      AbstractPathRoutines.buildInverse(graph,LearnerGraphND.ignoreNone,Inverse)// do the inverse to the tentative graph
View Full Code Here

    final Configuration shallowCopy = tentativeAutomaton.config.copy();shallowCopy.setLearnerCloneGraph(false);
    Set<Label> alphabet = tentativeAutomaton.learnerCache.getAlphabet();
    Map<Trace, MarkovOutcome> MarkovMatrix = getMarkov(predictForward);
    // mapping map to store all paths leave each state in different length
    @SuppressWarnings("rawtypes")
    AbstractLearnerGraph Inverse_Graph = computeInverseGraph(tentativeAutomaton, predictForward);
   
      for(Object vertObj:tentativeAutomaton.transitionMatrix.keySet())
      {
        CmpVertex vert = (CmpVertex)vertObj;
View Full Code Here

   * @return either an inverse or the original graph
   */
  @SuppressWarnings("rawtypes")
  public static AbstractLearnerGraph computeInverseGraph(LearnerGraph graph,boolean constructInverseOrForward)
  {
    AbstractLearnerGraph inverseGraph = null;
    if (constructInverseOrForward)
    {
      inverseGraph = computeInverseGraph(graph);
    }
    else
View Full Code Here

        actualAutomaton.setName("CVS");
//        Visualiser.updateFrame(actualAutomaton, referenceGraph); 
//        Visualiser.waitForKey();
        GD<List<CmpVertex>,List<CmpVertex>,LearnerGraphNDCachedData,LearnerGraphNDCachedData> gd =
                      new GD<List<CmpVertex>,List<CmpVertex>,LearnerGraphNDCachedData,LearnerGraphNDCachedData>();
                final AbstractLearnerGraph graph_Learnt = actualAutomaton;
                final AbstractLearnerGraph graph1=referenceGraph;
                DirectedSparseGraph gr = gd.showGD(graph_Learnt,graph1,ExperimentRunner.getCpuNumber());
                 Visualiser.updateFrame(gr, null);
                     
       
        if (verticesToMergeBasedOnInitialPTA != null && mergeIdentifiedPathsAfterInference)
View Full Code Here

    // 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;
    ConsistencyChecker checker = new MarkovUniversalLearner.InconsistencyNullVsPredicted(original);
    @SuppressWarnings("rawtypes")
    AbstractLearnerGraph Inverse_Graph = MarkovUniversalLearner.computeInverseGraph(result, predictForward);
    for(Entry<CmpVertex,Collection<Label>> entry:labelsAdded.entrySet())
      if (!entry.getValue().isEmpty())
      {
        double numberOfInconsistencies = Markov.checkFanoutInconsistency(Inverse_Graph,predictForward,result,entry.getKey(),Markov.getChunkLen(), checker);
View Full Code Here

TOP

Related Classes of statechum.analysis.learning.rpnicore.AbstractLearnerGraph

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.