/** * Sets the maximum number of iterations for this MessagePassingAlgorithm. * @param maxIter a {@code int} that represents the maximum number of iterations to be set. */ public void setMaxIter(int maxIter){ this.plateauStructure.getVMPTime0().setMaxIter(maxIter); this.plateauStructure.getVMPTimeT().setMaxIter(maxIter); }
((VMP)staticModelInference).setMaxIter(3000); break;
((VMP) currentModelInference).setMaxIter(3000); break;
public void initLearning() { //VMPParameter vmpParameter = new VMPParameter(this.svb.getPlateuStructure()); //vmpParameter.setMaxGlobaIter(1); //this.svb.getPlateuStructure().setVmp(vmpParameter); this.svb.getPlateuStructure().getVMP().setMaxIter(this.maximumLocalIterations); this.svb.getPlateuStructure().getVMP().setThreshold(this.localThreshold); this.svb.setDAG(this.dag); this.svb.setWindowsSize(batchSize); this.svb.initLearning(); //Init learning is peformed in each mapper. }
public void initLearning() { this.svb.getPlateuStructure().getVMP().setMaxIter(this.maximumLocalIterations); this.svb.getPlateuStructure().getVMP().setThreshold(this.localThreshold); this.svb.setDAG(this.dag); this.svb.setWindowsSize(batchSize); this.svb.initLearning(); //Init learning is peformed in each mapper. }
if (transitionMethod!=null) this.svbTimeT.setTransitionMethod(Serialization.deepCopy(transitionMethod)); this.svbTimeT.getPlateuStructure().getVMP().setMaxIter(this.maximumLocalIterations); this.svbTimeT.getPlateuStructure().getVMP().setThreshold(this.localThreshold); this.svbTimeT.setWindowsSize(this.batchSize);
vmp.setOutput(false); vmp.setTestELBO(true); vmp.setMaxIter(1000); vmp.setThreshold(0.0001);
public void initLearning() { VMPLocalUpdates vmpLocalUpdates = new VMPLocalUpdates(this.svb.getPlateuStructure()); //VMPParameterv1 vmpLocalUpdates = new VMPParameterv1(this.svb.getPlateuStructure()); this.svb.getPlateuStructure().setVmp(vmpLocalUpdates); this.svb.getPlateuStructure().getVMP().setMaxIter(this.maximumLocalIterations); this.svb.getPlateuStructure().getVMP().setThreshold(this.localThreshold); this.svb.setDAG(this.dag); this.svb.setWindowsSize(batchSize); this.svb.initLearning(); //Init learning is peformed in each mapper. }
public void initLearning() { VMPParameterv1 vmpParameter = new VMPParameterv1(this.svb.getPlateuStructure()); vmpParameter.setMaxGlobaIter(1); this.svb.getPlateuStructure().setVmp(vmpParameter); this.svb.getPlateuStructure().getVMP().setMaxIter(this.maximumLocalIterations); this.svb.getPlateuStructure().getVMP().setThreshold(this.localThreshold); this.svb.setDAG(this.dag); this.svb.setWindowsSize(batchSize); this.svb.initLearning(); //Init learning is peformed in each mapper. }
public static void main(String[] args) { DataStream<DataInstance> dataInstances = DataStreamLoader.open("/Users/andresmasegosa/Dropbox/Amidst/datasets/NFSAbstracts/abstractByYear/abstract_90.arff"); //DataOnMemory<DataInstance> dataInstances = DataStreamLoader.loadDataOnMemoryFromFile("/Users/andresmasegosa/Dropbox/Amidst/datasets/NFSAbstracts/abstractByYear/abstract_90.arff"); SVB svb = new SVB(); PlateauLDA plateauLDA = new PlateauLDA(dataInstances.getAttributes(),"word","count"); plateauLDA.setNTopics(10); plateauLDA.getVMP().setTestELBO(true); plateauLDA.getVMP().setMaxIter(10); plateauLDA.getVMP().setOutput(true); plateauLDA.getVMP().setThreshold(0.1); svb.setPlateuStructure(plateauLDA); svb.setOutput(true); svb.initLearning(); //System.out.println(dataInstances.getNumberOfDataInstances()); //svb.updateModel(dataInstances); BatchSpliteratorByID.streamOverDocuments(dataInstances, 500).sequential().forEach(batch -> { System.out.println("Batch: "+ batch.getNumberOfDataInstances()); svb.updateModel(batch); }); }
/** * This method contains the code to set up the plateau model. * @param dag, the DAG to be replicated * @return A properly initialized {@link ParallelSVB} object. */ public static ParallelSVB plateuModelSetUp(DAG dag){ //We access the hidden var Variable hiddenGaussian = dag.getVariables().getVariableByName("HiddenGaussian"); //We create the ParalleVB object which will perform the learning ParallelSVB parallelSVB = new ParallelSVB(); //Set the DAG parallelSVB.setDAG(dag); //We tell how the above DAG should be expanded. parallelSVB.getSVBEngine().setPlateuStructure(new PlateuIIDReplication(Arrays.asList(hiddenGaussian))); //We also tell how to evolve the hidden variable over time GaussianHiddenTransitionMethod gaussianHiddenTransitionMethod = new GaussianHiddenTransitionMethod(Arrays.asList(hiddenGaussian), 0, 0.1); parallelSVB.getSVBEngine().setTransitionMethod(gaussianHiddenTransitionMethod); //We set the window/batch size used for learning parallelSVB.getSVBEngine().setWindowsSize(100); //We set the maximum number of iteration of the VMP method parallelSVB.getSVBEngine().getPlateuStructure().getVMP().setMaxIter(100); //We set the threshold definining the convergence of the VMP method parallelSVB.getSVBEngine().getPlateuStructure().getVMP().setThreshold(0.001); //We do not allow for debuggin info. parallelSVB.setOutput(false); //We invoke the setup of the underlying data structures parallelSVB.initLearning(); return parallelSVB; }
if (INITIALIZE && superstep==0) { VMP vmp = new VMP(); vmp.setMaxIter(this.svb.getPlateuStructure().getVMP().getMaxIter()); vmp.setThreshold(this.svb.getPlateuStructure().getVMP().getThreshold()); vmp.setTestELBO(this.svb.getPlateuStructure().getVMP().isOutput());
protected void initLearning() { if(learningAlgorithm==null) { SVB svb = new SVB(); svb.setWindowsSize(100); svb.getPlateuStructure().getVMP().setTestELBO(false); svb.getPlateuStructure().getVMP().setMaxIter(100); svb.getPlateuStructure().getVMP().setThreshold(0.00001); learningAlgorithm = svb; } learningAlgorithm.setWindowsSize(windowSize); if (this.getDAG()!=null) learningAlgorithm.setDAG(this.getDAG()); else if (this.getPlateuStructure()!=null) ((BayesianParameterLearningAlgorithm)learningAlgorithm).setPlateuStructure(this.getPlateuStructure()); else throw new IllegalArgumentException("Non provided dag or PlateauStructure"); learningAlgorithm.setOutput(true); learningAlgorithm.initLearning(); initialized=true; }
vmp.setOutput(false); vmp.setTestELBO(true); vmp.setMaxIter(1000); vmp.setThreshold(0.0001);
if (INITIALIZE && superstep==0) { VMP vmp = new VMP(); vmp.setMaxIter(this.svb.getPlateuStructure().getVMP().getMaxIter()); vmp.setThreshold(this.svb.getPlateuStructure().getVMP().getThreshold()); vmp.setTestELBO(this.svb.getPlateuStructure().getVMP().isOutput());
@Override protected void initLearning() { if(learningAlgorithm==null) { SVB svb = new SVB(); plateauLDA = new PlateauLDA(this.atts, "word", "count"); plateauLDA.setNTopics(ntopics); svb.setPlateuStructure(plateauLDA); svb.getPlateuStructure().getVMP().setTestELBO(false); svb.getPlateuStructure().getVMP().setMaxIter(100); svb.getPlateuStructure().getVMP().setThreshold(0.01); learningAlgorithm = svb; } learningAlgorithm.setWindowsSize(100); learningAlgorithm.setOutput(true); learningAlgorithm.initLearning(); initialized=true; }
@Override protected void initLearning() { if (this.getDAG()==null) buildDAG(); if(learningAlgorithm==null) { SVB svb = new SVB(); svb.setSeed(this.seed); svb.setPlateuStructure(new PlateuIIDReplication(hiddenVars)); GaussianHiddenTransitionMethod gaussianHiddenTransitionMethod = new GaussianHiddenTransitionMethod(hiddenVars, 0, this.transitionVariance); gaussianHiddenTransitionMethod.setFading(fading); svb.setTransitionMethod(gaussianHiddenTransitionMethod); svb.setDAG(dag); svb.setOutput(false); svb.getPlateuStructure().getVMP().setMaxIter(1000); svb.getPlateuStructure().getVMP().setThreshold(0.001); learningAlgorithm = svb; } learningAlgorithm.setWindowsSize(windowSize); if (this.getDAG()!=null) learningAlgorithm.setDAG(this.getDAG()); else throw new IllegalArgumentException("Non provided dag"); learningAlgorithm.setOutput(false); learningAlgorithm.initLearning(); initialized=true; }