Examples of learnMachine()


Examples of statechum.analysis.learning.Learner.learnMachine()

    //l.setCertaintyThreshold(5);
    testConfig.setLearnerIdMode(IDMode.POSITIVE_NEGATIVE);
    LearnerGraph learntStructureA = new LearnerGraph(l.learnMachine(buildSet(plus,testConfig,getLabelConverter()), buildSet(minus,testConfig,getLabelConverter())),expected.config);
    // Now do the same with ptasets instead of real sets
    PTASequenceSet plusPTA = new PTASequenceSet();plusPTA.addAll(buildSet(plus,testConfig,getLabelConverter()));PTASequenceSet minusPTA = new PTASequenceSet();minusPTA.addAll(buildSet(minus,testConfig,getLabelConverter()));
    LearnerGraph learntStructureB = new LearnerGraph(l.learnMachine(plusPTA, minusPTA),expected.config);
    Assert.assertNull(WMethod.checkM(learntStructureA, learntStructureB));
    LearnerGraph learntMachineNoRejects = new LearnerGraph(expected.config);
    AbstractPathRoutines.removeRejectStates(learntStructureA,learntMachineNoRejects);
    /*
    if (null != WMethod.checkM(learntMachineNoRejects, expected))
View Full Code Here

Examples of statechum.analysis.learning.Learner.learnMachine()

        innerLearner.addObserver(PickNegativesVisualiser.this);
        Learner mainDecorator = new AutoAnswers(innerLearner);
        if (conf.labelDetails != null)
          mainDecorator = new SmtLearnerDecorator(mainDecorator,conf.labelDetails);
            if (whomToNotify != null) whomToNotify.threadStarted();
            LearnerGraph graph = mainDecorator.learnMachine(sPlus, sMinus);
            if (graph != null)
            {
              DirectedSparseGraph learnt = graph.pathroutines.getGraph();
              if(conf.config.isGenerateTextOutput())
                OutputUtil.generateTextOutput(learnt,"textOutput.txt");
View Full Code Here

Examples of statechum.analysis.learning.Learner.learnMachine()

        innerLearner.addObserver(PickNegativesVisualiser.this);
        Learner mainDecorator = new AutoAnswers(innerLearner);
        if (conf.labelDetails != null)
          mainDecorator = new SmtLearnerDecorator(mainDecorator,conf.labelDetails);
            if (whomToNotify != null) whomToNotify.threadStarted();
            LearnerGraph graph = mainDecorator.learnMachine(sPlus, sMinus);
            if (graph != null)
            {
              try
              {
                DirectedSparseGraph learnt = graph.pathroutines.getGraph();
View Full Code Here

Examples of statechum.analysis.learning.RPNIBlueFringeLearnerTestComponentOpt.learnMachine()

    PTASequenceEngine sPlus = null, sMinus = null;int percent = 10;
    sPlus = rpg.getExtraSequences(percent/10-1);sMinus = rpg.getAllSequences(percent/10-1);

    int ptaSize = sMinus.numberOfLeafNodes();
    l.init(sMinus, ptaSize,ptaSize);// our imaginary positives are prefixes of negatives.
    DirectedSparseGraph learningOutcome = l.learnMachine();
    l.setQuestionCounter(0);
    LearnerGraph learned = new LearnerGraph(learningOutcome,config);
    PTA_computePrecisionRecall precRec = new PTA_computePrecisionRecall(learned);
    PTASequenceEngine engine = new PTA_FSMStructure(graph);
    precRec.crossWith(sMinus);
View Full Code Here

Examples of statechum.analysis.learning.RPNIBlueFringeLearnerTestComponentOpt.learnMachine()

      int ptaElements = pta.numberOfLeafNodes();

      stats = stats+"Instance: "+instanceID+", learner: "+this+", pta: "+ptaElements+" tests: "+tests.size()+ "\n";
      l.init(pta, ptaElements/2,ptaElements/2);

      learningOutcome = l.learnMachine();
      result = result+l.getQuestionCounter()+FS+computeAccuracy(learningOutcome, graph.paths.getGraph(),tests);
      System.out.print(computeAccuracy(learningOutcome, graph.paths.getGraph(),tests)+",");
      //System.out.println(instanceID+","+result);
      //updateFrame(g,learningOutcome);
      l.setQuestionCounter(0);
View Full Code Here

Examples of statechum.analysis.learning.RPNIUniversalLearner.learnMachine()

                            if (learnerInitConfiguration.graph != null)
                            {
                              learnerInitConfiguration.graph.clearColours();learnerInitConfiguration.graph.getInit().setColour(JUConstants.RED);
                              LearnerGraph.copyGraphs(learnerInitConfiguration.graph,learner.getTentativeAutomaton());
                            }
                            LearnerGraph graphLearnt = learner.learnMachine();
                            outcome = new OtpErlangTuple(new OtpErlangObject[]{ref,msgOk,  constructFSM(graphLearnt)});
                          }
                          catch(AskedToTerminateException e)
                          {
                            outcome = new OtpErlangTuple(new OtpErlangObject[]{ref,msgTerminate});
View Full Code Here

Examples of statechum.analysis.learning.RPNIUniversalLearner.learnMachine()

                            if (learnerInitConfiguration.graph != null)
                            {
                              learnerInitConfiguration.graph.clearColours();learnerInitConfiguration.graph.getInit().setColour(JUConstants.RED);
                              LearnerGraph.copyGraphs(learnerInitConfiguration.graph,learner.getTentativeAutomaton());
                            }
                            LearnerGraph graphLearnt = learner.learnMachine(new LinkedList<List<Label>>(),new LinkedList<List<Label>>());
                            outcome = new OtpErlangTuple(new OtpErlangObject[]{ref,msgOk,  constructFSM(graphLearnt)});
                          }
                          catch(AskedToTerminateException e)
                          {
                            outcome = new OtpErlangTuple(new OtpErlangObject[]{ref,msgTerminate});
View Full Code Here

Examples of statechum.analysis.learning.RPNIUniversalLearner.learnMachine()

                             
                            };
                            if (learnerInitConfiguration.config.getAskQuestions()) // only generate initial traces if we are permited to ask questions.
                              learner.init(learner.GenerateInitialTraces(learnerInitConfiguration.config.getErlangInitialTraceLength()),0,0);
                            System.out.println("random trace generation complete");
                            LearnerGraph graphLearnt = learner.learnMachine(),
                                graphWithTrimmedLabels = new LearnerGraph(learnerInitConfiguration.config);
                           
                            if (learnerInitConfiguration.config.getErlangStripModuleNamesFromFunctionsInNonGenModules())
                              convertLabelsToStrings(graphLearnt,graphWithTrimmedLabels);
                            else
View Full Code Here

Examples of statechum.analysis.learning.RPNIUniversalLearner.learnMachine()

                            if (learnerInitConfiguration.graph != null)
                            {
                              learnerInitConfiguration.graph.clearColours();learnerInitConfiguration.graph.getInit().setColour(JUConstants.RED);
                              LearnerGraph.copyGraphs(learnerInitConfiguration.graph,learner.getTentativeAutomaton());
                            }
                            LearnerGraph graphLearnt = learner.learnMachine();
                            outcome = new OtpErlangTuple(new OtpErlangObject[]{ref,msgOk,  constructFSM(graphLearnt)});
                          }
                          catch(AskedToTerminateException e)
                          {
                            outcome = new OtpErlangTuple(new OtpErlangObject[]{ref,msgTerminate});
View Full Code Here

Examples of statechum.analysis.learning.RPNIUniversalLearner.learnMachine()

                            if (learnerInitConfiguration.graph != null)
                            {
                              learnerInitConfiguration.graph.clearColours();learnerInitConfiguration.graph.getInit().setColour(JUConstants.RED);
                              LearnerGraph.copyGraphs(learnerInitConfiguration.graph,learner.getTentativeAutomaton());
                            }
                            LearnerGraph graphLearnt = learner.learnMachine(new LinkedList<List<Label>>(),new LinkedList<List<Label>>());
                            outcome = new OtpErlangTuple(new OtpErlangObject[]{ref,msgOk,  constructFSM(graphLearnt)});
                          }
                          catch(AskedToTerminateException e)
                          {
                            outcome = new OtpErlangTuple(new OtpErlangObject[]{ref,msgTerminate});
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.