@Test public void test() throws Exception { SVBforDBN.main(null); }
public static void main(String[] args) throws IOException { Random random = new Random(1); DynamicBayesianNetworkGenerator.setNumberOfContinuousVars(2); DynamicBayesianNetworkGenerator.setNumberOfDiscreteVars(5); DynamicBayesianNetworkGenerator.setNumberOfStates(3); DynamicBayesianNetwork dbnRandom = DynamicBayesianNetworkGenerator.generateDynamicNaiveBayes(random,2,true); DynamicBayesianNetworkSampler sampler = new DynamicBayesianNetworkSampler(dbnRandom); sampler.setSeed(0); DataStream<DynamicDataInstance> data = sampler.sampleToDataBase(3,10000); SVB svb = new SVB(); svb.setWindowsSize(100); svb.setSeed(0); VMP vmp = svb.getPlateauStructure().getVMPTimeT(); vmp.setOutput(false); vmp.setTestELBO(true); vmp.setMaxIter(1000); vmp.setThreshold(0.0001); svb.setDynamicDAG(dbnRandom.getDynamicDAG()); svb.setDataStream(data); svb.runLearning(); DynamicBayesianNetwork dbnLearnt = svb.getLearntDBN(); System.out.println(dbnLearnt.toString()); }
SVBforDBN { public static void main(String[] args) throws IOException { Random random = new Random(1); DynamicBayesianNetworkGenerator.setNumberOfContinuousVars(2); DynamicBayesianNetworkGenerator.setNumberOfDiscreteVars(5); DynamicBayesianNetworkGenerator.setNumberOfStates(3); DynamicBayesianNetwork dbnRandom = DynamicBayesianNetworkGenerator.generateDynamicNaiveBayes(random,2,true); DynamicBayesianNetworkSampler sampler = new DynamicBayesianNetworkSampler(dbnRandom); sampler.setSeed(0); DataStream<DynamicDataInstance> data = sampler.sampleToDataBase(3,10000); SVB svb = new SVB(); svb.setWindowsSize(100); svb.setSeed(0); VMP vmp = svb.getPlateauStructure().getVMPTimeT(); vmp.setOutput(false); vmp.setTestELBO(true); vmp.setMaxIter(1000); vmp.setThreshold(0.0001); svb.setDynamicDAG(dbnRandom.getDynamicDAG()); svb.setDataStream(data); svb.runLearning(); DynamicBayesianNetwork dbnLearnt = svb.getLearntDBN(); System.out.println(dbnLearnt.toString()); } }
SVBforDBN { public static void main(String[] args) throws IOException { Random random = new Random(1); DynamicBayesianNetworkGenerator.setNumberOfContinuousVars(2); DynamicBayesianNetworkGenerator.setNumberOfDiscreteVars(5); DynamicBayesianNetworkGenerator.setNumberOfStates(3); DynamicBayesianNetwork dbnRandom = DynamicBayesianNetworkGenerator.generateDynamicNaiveBayes(random,2,true); DynamicBayesianNetworkSampler sampler = new DynamicBayesianNetworkSampler(dbnRandom); sampler.setSeed(0); DataStream<DynamicDataInstance> data = sampler.sampleToDataBase(3,10000); SVB svb = new SVB(); svb.setWindowsSize(100); svb.setSeed(0); VMP vmp = svb.getPlateauStructure().getVMPTimeT(); vmp.setOutput(false); vmp.setTestELBO(true); vmp.setMaxIter(1000); vmp.setThreshold(0.0001); svb.setDynamicDAG(dbnRandom.getDynamicDAG()); svb.setDataStream(data); svb.runLearning(); DynamicBayesianNetwork dbnLearnt = svb.getLearntDBN(); System.out.println(dbnLearnt.toString()); }  }
SVBforDBN { public static void main(String[] args) throws IOException { Random random = new Random(1); DynamicBayesianNetworkGenerator.setNumberOfContinuousVars(2); DynamicBayesianNetworkGenerator.setNumberOfDiscreteVars(5); DynamicBayesianNetworkGenerator.setNumberOfStates(3); DynamicBayesianNetwork dbnRandom = DynamicBayesianNetworkGenerator.generateDynamicNaiveBayes(random,2,true); DynamicBayesianNetworkSampler sampler = new DynamicBayesianNetworkSampler(dbnRandom); sampler.setSeed(0); DataStream<DynamicDataInstance> data = sampler.sampleToDataBase(3,10000); SVB svb = new SVB(); svb.setWindowsSize(100); svb.setSeed(0); VMP vmp = svb.getPlateauStructure().getVMPTimeT(); vmp.setOutput(false); vmp.setTestELBO(true); vmp.setMaxIter(1000); vmp.setThreshold(0.0001); svb.setDynamicDAG(dbnRandom.getDynamicDAG()); svb.setDataStream(data); svb.runLearning(); DynamicBayesianNetwork dbnLearnt = svb.getLearntDBN(); System.out.println(dbnLearnt.toString()); }  static void main(String[] args); }
SVBforDBN { public static void main(String[] args) throws IOException { Random random = new Random(1); DynamicBayesianNetworkGenerator.setNumberOfContinuousVars(2); DynamicBayesianNetworkGenerator.setNumberOfDiscreteVars(5); DynamicBayesianNetworkGenerator.setNumberOfStates(3); DynamicBayesianNetwork dbnRandom = DynamicBayesianNetworkGenerator.generateDynamicNaiveBayes(random,2,true); DynamicBayesianNetworkSampler sampler = new DynamicBayesianNetworkSampler(dbnRandom); sampler.setSeed(0); DataStream<DynamicDataInstance> data = sampler.sampleToDataBase(3,10000); SVB svb = new SVB(); svb.setWindowsSize(100); svb.setSeed(0); VMP vmp = svb.getPlateauStructure().getVMPTimeT(); vmp.setOutput(false); vmp.setTestELBO(true); vmp.setMaxIter(1000); vmp.setThreshold(0.0001); svb.setDynamicDAG(dbnRandom.getDynamicDAG()); svb.setDataStream(data); svb.runLearning(); DynamicBayesianNetwork dbnLearnt = svb.getLearntDBN(); System.out.println(dbnLearnt.toString()); }  static void main(String[] args);  }