/** * Returns the log probability of the evidence at time T. * @return a {@link double} value that represents the log probability of the evidence at time T. */ public double getLogProbabilityOfEvidenceTimeT() { return this.vmpTimeT.getLogProbabilityOfEvidence(); }
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. }
/** * Moves the exponential family distributions. * @param toTemporalCloneNode a {@link Node} object. * @param fromNode a {@link Node} object. */ private static void moveNodeQDist(Node toTemporalCloneNode, Node fromNode){ EF_UnivariateDistribution uni = fromNode.getQDist().deepCopy(toTemporalCloneNode.getMainVariable()); toTemporalCloneNode.setPDist(uni); toTemporalCloneNode.setQDist(uni); }
/** * Sets the evidence for this PlateuStructure. * * @param data a {@code List} of {@link DataInstance}. */ public void setEvidence(List<? extends DataInstance> data) { this.data = data; this.replicateModelForDocs(); //And reset the Q's of the new replicated nodes. this.getReplicatedNodes().filter(node -> !node.isObserved()).forEach(node -> { node.resetQDist(this.vmp.getRandom()); }); }
/** * 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); }
/** * Sets the threshold for this MessagePassingAlgorithm. * @param threshold a {@code double} that represents the threshold value to be set. */ public void setThreshold(double threshold) { this.plateauStructure.getVMPTime0().setThreshold(threshold); this.plateauStructure.getVMPTimeT().setThreshold(threshold); }
/** * Resets the exponential family distributions of all nodes for the {@link VMP} object of this PlateuStructure. */ public void resetQs() { //And reset the Q's of the new replicated nodes. this.getNonReplictedNodes().filter(node -> node.isActive()).forEach(node -> { node.resetQDist(this.vmp.getRandom()); }); }
/** * Activate the output for the underlying MessagePassingAlgorithm. * @param output a {@code boolean} that represents the output value to be set. */ public void setOutput(boolean output){ this.plateauStructure.getVMPTime0().setOutput(output); this.plateauStructure.getVMPTimeT().setOutput(output); }
/** * Sets the evidence at time 0. * @param data a {@link DynamicDataInstance} object. */ public void setEvidenceTime0(DynamicDataInstance data) { this.vmpTime0.setEvidence(data); }
/** * {@inheritDoc} */ @Override public <E extends UnivariateDistribution> E getFilteredPosterior(Variable var) { return (getTimeIDOfPosterior()==0)? this.vmpTime0.getPosterior(var): this.vmpTimeT.getPosterior(var); }
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. }
private static void moveNodeQDist(Node toTemporalCloneNode, Node fromNode){ EF_UnivariateDistribution uni = fromNode.getQDist().deepCopy(toTemporalCloneNode.getMainVariable()); toTemporalCloneNode.setPDist(uni); toTemporalCloneNode.setQDist(uni); }
/** * Sets the evidence for this PlateuStructure. * * @param data a {@code List} of {@link DataInstance}. */ public void setEvidence(List<? extends DataInstance> data) { this.data = data; this.replicateModelForDocs(); //And reset the Q's of the new replicated nodes. this.getReplicatedNodes().filter(node -> !node.isObserved()).forEach(node -> { node.resetQDist(this.vmp.getRandom()); }); }
/** * Resets the exponential family distributions of all nodes for the {@link VMP} object of this PlateuStructure. */ public void resetQs() { //And reset the Q's of the new replicated nodes. this.getNonReplictedNodes().filter(node -> node.isActive()).forEach(node -> { node.resetQDist(this.vmp.getRandom()); }); }
/** * Returns the log probability of the evidence at time T. * @return a {@link double} value that represents the log probability of the evidence at time T. */ public double getLogProbabilityOfEvidenceTime0() { return this.vmpTime0.getLogProbabilityOfEvidence(); }