@Test public void testFading() throws IOException, ClassNotFoundException { BayesianNetwork trueBN = BayesianNetworkLoader.loadFromFile("../networks/simulated/WasteIncinerator.bn"); if (Main.VERBOSE) System.out.println("\nWasteIncinerator network \n "); if (Main.VERBOSE) System.out.println(trueBN.getDAG().toString()); if (Main.VERBOSE) System.out.println(trueBN.toString()); BayesianNetworkSampler sampler = new BayesianNetworkSampler(trueBN); sampler.setSeed(0); DataStream<DataInstance> data = sampler.sampleToDataStream(10000); SVBFading svbFading = new SVBFading(); svbFading.setFadingFactor(0.95); VMP vmp = svbFading.getPlateuStructure().getVMP(); vmp.setTestELBO(true); vmp.setMaxIter(500); vmp.setThreshold(0.0001); svbFading.setWindowsSize(1000); svbFading.setDAG(trueBN.getDAG()); svbFading.setDataStream(data); svbFading.runLearning(); BayesianNetwork bnet = svbFading.getLearntBayesianNetwork(); for (Variable var : trueBN.getVariables()) { if (Main.VERBOSE) System.out.println("\n------ Variable " + var.getName() + " ------"); if (Main.VERBOSE) System.out.println("\nTrue distribution:\n"+ trueBN.getConditionalDistribution(var)); if (Main.VERBOSE) System.out.println("\nLearned distribution:\n"+ bnet.getConditionalDistribution(var)); Assert.assertTrue(bnet.getConditionalDistribution(var).equalDist(trueBN.getConditionalDistribution(var), 0.5)); } Assert.assertTrue(bnet.equalBNs(trueBN, 0.5)); }
public void setFadingFactor(double fadingFactor) { ((Fading)this.getTransitionMethod()).setFadingFactor(fadingFactor); }
SVBFading extends SVB implements FadingLearner { public void setFadingFactor(double fadingFactor) { ((Fading)this.getTransitionMethod()).setFadingFactor(fadingFactor); } }
SVBFading extends SVB implements FadingLearner { public void setFadingFactor(double fadingFactor) { ((Fading)this.getTransitionMethod()).setFadingFactor(fadingFactor); } SVBFading(); }
SVBFading extends SVB implements FadingLearner { public void setFadingFactor(double fadingFactor) { ((Fading)this.getTransitionMethod()).setFadingFactor(fadingFactor); } SVBFading(); double getFadingFactor(); void setFadingFactor(double fadingFactor); }
SVBFading extends SVB implements FadingLearner { public void setFadingFactor(double fadingFactor) { ((Fading)this.getTransitionMethod()).setFadingFactor(fadingFactor); } SVBFading(); double getFadingFactor(); void setFadingFactor(double fadingFactor);  }