Skip to content

Commit

Permalink
Minor change to BayesianNetworkSampling: from "BayesianNetwork" to "D…
Browse files Browse the repository at this point in the history
…AGModel<BayesianFactor>"".
  • Loading branch information
cbonesana committed Feb 9, 2021
1 parent 26a85f4 commit 8d232d7
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ch.idsia.crema.inference.sampling;

import ch.idsia.crema.factor.bayesian.BayesianFactor;
import ch.idsia.crema.model.graphical.BayesianNetwork;
import ch.idsia.crema.model.graphical.DAGModel;
import ch.idsia.crema.utility.ArraysUtil;
import gnu.trove.map.TIntIntMap;
import gnu.trove.map.hash.TIntIntHashMap;
Expand All @@ -20,7 +20,7 @@ public class BayesianNetworkSampling {
* @param vars
* @return
*/
public TIntIntMap sample(BayesianNetwork model, int... vars) {
public TIntIntMap sample(DAGModel<BayesianFactor> model, int... vars) {
TIntIntMap obs = new TIntIntHashMap();

// follow DAG in topological order
Expand Down Expand Up @@ -48,7 +48,7 @@ public TIntIntMap sample(BayesianNetwork model, int... vars) {
* @param vars
* @return
*/
public TIntIntMap[] samples(BayesianNetwork model, int N, int... vars) {
public TIntIntMap[] samples(DAGModel<BayesianFactor> model, int N, int... vars) {
return IntStream.range(0, N).mapToObj(i -> sample(model, vars)).toArray(TIntIntMap[]::new);
}

Expand Down

0 comments on commit 8d232d7

Please sign in to comment.