Package statechum

Examples of statechum.Configuration


    {
      forwardOrInverseGraph = new LearnerGraphND(graph,graph.config);
    }
    else
    {
      Configuration shallowCopy = graph.config.copy();shallowCopy.setLearnerCloneGraph(false);
      forwardOrInverseGraph = new LearnerGraphND(shallowCopy);forwardOrInverseGraph.initEmpty();
      AbstractPathRoutines.buildInverse(graph,LearnerGraphND.ignoreNone,forwardOrInverseGraph)// do the inverse to the tentative graph
    }

    Map<CmpVertex,LearnerGraph> outcome = new TreeMap<CmpVertex,LearnerGraph>();
View Full Code Here


  {
    InitialConfigurationAndData outcome = new InitialConfigurationAndData();
   
    final java.io.FileInputStream inputStream = new java.io.FileInputStream(argPTAFileName);
    final LearnerSimulator simulator = new LearnerSimulator(inputStream,true,converter);
    Configuration defaultConfig = configToUse.copy();
    //defaultConfig.setRejectPositivePairsWithScoresLessThan(1);
    assert converter != null : "we expect this methods to be used with large graphs and Array matrix types hence converter must be set";
    outcome.learnerInitConfiguration = simulator.readLearnerConstructionData(defaultConfig);
    outcome.learnerInitConfiguration.setLabelConverter(converter);
   
View Full Code Here

 
  @SuppressWarnings("null")
  public static void runExperiment() throws Exception
  {
    DrawGraphs gr = new DrawGraphs();
    Configuration config = Configuration.getDefaultConfiguration().copy();config.setAskQuestions(false);config.setDebugMode(false);config.setGdLowToHighRatio(0.7);config.setRandomPathAttemptFudgeThreshold(1000);
    config.setTransitionMatrixImplType(STATETREE.STATETREE_LINKEDHASH);
    ConvertALabel converter = new Transform.InternStringLabel();
    //gr_NewToOrig.setLimit(7000);
    GlobalConfiguration.getConfiguration().setProperty(G_PROPERTIES.LINEARWARNINGS, "false");
    final int ThreadNumber = ExperimentRunner.getCpuNumber();
   
View Full Code Here

       PTASequenceEngine engine = collectionOfTraces.get(UAVAllSeeds).tracesForUAVandFrame.get(UAVAllSeeds).get(maxFrameNumber);
      
       FileOutputStream log = new java.io.FileOutputStream("resources/largePTA/VeryLargePTA.zip");
       RPNIBlueFringeVariability ourLearner = new RPNIBlueFringeVariability(learnerInitConfiguration,true,null,null);
       LearnerGraph automatonAfterInit = ourLearner.getLearner().init(engine,0,0);
       final Configuration shallowCopy = automatonAfterInit.config.copy();shallowCopy.setLearnerCloneGraph(false);
       LearnerGraph copyOfAutomaton = new LearnerGraph(shallowCopy);LearnerGraph.copyGraphs(automatonAfterInit, copyOfAutomaton);
       ourLearner.setInitPta(copyOfAutomaton);
       RecordProgressDecorator recorder = new RecordProgressDecorator(ourLearner.getLearner(),log,1,learnerInitConfiguration.config,true);
       learnerInitConfiguration.graph = smallPTA;learnerInitConfiguration.testSet = new LinkedList<List<statechum.Label>>();
    recorder.writeLearnerEvaluationData(learnerInitConfiguration);
View Full Code Here

   */
  public static void mainSingleHugeAutomaton(String[] args) throws Exception
  {
    PaperUAS paper = new PaperUAS();
      paper.learnerInitConfiguration.setLabelConverter(new Transform.InternStringLabel());
        final Configuration learnerConfig = paper.learnerInitConfiguration.config;learnerConfig.setGeneralisationThreshold(0);learnerConfig.setGdFailOnDuplicateNames(false);
        learnerConfig.setGdLowToHighRatio(0.75);learnerConfig.setGdKeyPairThreshold(0.5);learnerConfig.setTransitionMatrixImplType(STATETREE.STATETREE_ARRAY);
        learnerConfig.setAskQuestions(false);learnerConfig.setDebugMode(false);
        paper.loadReducedConfigurationFile(args[0]);
       
    final int offset=1;
      Reader []inputFiles = new Reader[args.length-offset];for(int i=offset;i<args.length;++i) inputFiles[i-offset]=new FileReader(args[i]);
      int maxFrame = paper.getMaxFrame(inputFiles);
View Full Code Here

   * @param graph what to invert.
   * @return inverted graph
   */
  public static LearnerGraphND computeInverseGraph(LearnerGraph graph)
  {
    Configuration shallowCopy = graph.config.copy();shallowCopy.setLearnerCloneGraph(false);
    LearnerGraphND inverseGraph = new LearnerGraphND(shallowCopy);inverseGraph.initEmpty();
    AbstractPathRoutines.buildInverse(graph,LearnerGraphND.ignoreNone,inverseGraph)// do the inverse to the tentative graph
    return inverseGraph;
  }
View Full Code Here

    /** Maps states to a function associating labels to a sum of probabilities from a Markov matrix. Such a sum is supposed to predict the likelyhood of a transition with this label from every state. */
    Map<CmpVertex,Map<Label,UpdatablePairInteger>> state_outgoing_occurence=new HashMap<CmpVertex,Map<Label,UpdatablePairInteger>>();
    /** Maps states to a function associating labels to a probability of a transition with the label of interest from a state of interest. Computed from {@link MarkovUniversalLearner#state_outgoing_occurence}. */
    Map<CmpVertex,Map<Label,UpdatablePairDouble>> state_outgoing=new HashMap<CmpVertex,Map<Label,UpdatablePairDouble>>();

    final Configuration shallowCopy = graph.config.copy();shallowCopy.setLearnerCloneGraph(false);
    LearnerGraph outcome = new LearnerGraph(shallowCopy);
    LearnerGraph.copyGraphs(graph, outcome);
    final Set<Label> allElementsOfAlphabet = graph.learnerCache.getAlphabet();
    // mapping map to store all paths leave each state in different length
      for(CmpVertex vert:graph.transitionMatrix.keySet())
View Full Code Here

   */
  public static void mainSmallAutomata(String[] args) throws Exception
  {
    PaperUAS paper = new PaperUAS();
    paper.learnerInitConfiguration.setLabelConverter(new Transform.InternStringLabel());
        final Configuration learnerConfig = paper.learnerInitConfiguration.config;learnerConfig.setGeneralisationThreshold(0);learnerConfig.setGdFailOnDuplicateNames(false);
        learnerConfig.setGdLowToHighRatio(0.75);learnerConfig.setGdKeyPairThreshold(0.5);learnerConfig.setTransitionMatrixImplType(STATETREE.STATETREE_ARRAY);
        learnerConfig.setAskQuestions(false);learnerConfig.setDebugMode(false);
        learnerConfig.setLearnerScoreMode(Configuration.ScoreMode.GENERAL);
        paper.loadReducedConfigurationFile(args[0]);
       
    final int offset=1;
      Reader []inputFiles = new Reader[args.length-offset];for(int i=offset;i<args.length;++i) inputFiles[i-offset]=new FileReader(args[i]);
      int maxFrame = paper.getMaxFrame(inputFiles);
View Full Code Here

      throw new IllegalArgumentException("predictions are only supported in the forward direction, not inverse");

    /** Maps states to a function associating labels to a probability of a transition with the label of interest from a state of interest. Computed from {@link MarkovUniversalLearner#state_outgoing_occurence}. */
    Map<CmpVertex,Map<Label,MarkovOutcome>> state_outgoing=predictTransitions();

    final Configuration shallowCopy = graph.config.copy();shallowCopy.setLearnerCloneGraph(false);
    LearnerGraph graphWithPredictedTransitions = new LearnerGraph(shallowCopy);
    LearnerGraph.copyGraphs(graph, graphWithPredictedTransitions);

    // in this part the tree is extended depend on their outgoing transition probabilities
     for(Entry<CmpVertex, Map<Label, MarkovOutcome>> outgoing:state_outgoing.entrySet())
View Full Code Here

  public Map<CmpVertex, Map<Label, MarkovOutcome>> predictTransitions()
  {
    /** Maps states to a function associating labels to a probability of a transition with the label of interest from a state of interest. Computed from {@link MarkovUniversalLearner#state_outgoing_occurence}. */
    Map<CmpVertex,Map<Label,MarkovOutcome>> state_outgoing=new HashMap<CmpVertex,Map<Label,MarkovOutcome>>();

    final Configuration shallowCopy = graph.config.copy();shallowCopy.setLearnerCloneGraph(false);

      for(CmpVertex vert:graph.transitionMatrix.keySet())
        if(vert.isAccept() )
            {
             Map<Label,MarkovOutcome> outgoing_labels_probabilities=predictTransitionsFromState(vert,null,model.getChunkLen(),null);
View Full Code Here

TOP

Related Classes of statechum.Configuration

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.