@@ -24,36 +24,33 @@ public class Starting {
2424 /* CN defined with vertex Factor */
2525
2626 // Define the model (with vertex factors)
27- SparseModel model = new SparseModel ();
28- int A = model. addVariable(3 );
27+ SparseModel< VertexFactor > model = new SparseModel<> ();
28+ int A = model. addVariable(3 );
2929 int B = model. addVariable(2 );
30+
3031 model. addParent(B ,A );
3132
3233 // Define a credal set of the partent node
3334 VertexFactor fu = new VertexFactor (model. getDomain(A ), Strides . empty());
3435 fu. addVertex(new double []{0. , 1 - p, p});
3536 fu. addVertex(new double []{1 - p, 0. , p});
37+
3638 model. setFactor(A ,fu);
3739
3840
3941 // Define the credal set of the child
4042 VertexFactor fx = new VertexFactor (model. getDomain(B ), model. getDomain(A ));
41-
4243 fx. addVertex(new double []{1. , 0. ,}, 0 );
4344 fx. addVertex(new double []{1. , 0. ,}, 1 );
4445 fx. addVertex(new double []{0. , 1. ,}, 2 );
4546
4647 model. setFactor(B ,fx);
4748
4849 // Run exact inference
49- CredalVariableElimination inf = new CredalVariableElimination (model);
50+ CredalVariableElimination< VertexFactor > inf = new CredalVariableElimination<> (model);
5051 inf. query(A , ObservationBuilder . observe(B ,0 ));
51-
5252 }
5353}
54-
55-
56-
5754```
5855
5956## Installation
@@ -76,4 +73,32 @@ Add the following code in the pom.xml of your project:
7673 <scope >compile</scope >
7774 </dependency >
7875 </dependencies >
79- ```
76+ ```
77+
78+ ## Citation
79+
80+ If you write a scientific paper describing research that made use of the CREMA library, please cite the following paper:
81+
82+ ```
83+ Huber, D., Cabañas, R., Antonucci, A., Zaffalon, M. (2020).
84+ CREMA: a Java library for credal network inference.
85+ In Jaeger, M., Nielsen, T.D. (Eds),
86+ Proceedings of the 10th International Conference on Probabilistic Graphical Models (PGM 2020),
87+ Proceedings of Machine Learning Research, PMLR, Aalborg, Denmark.
88+ ```
89+
90+ In BiBTeX format (for your convenience):
91+
92+ ``` bibtex
93+ @INPROCEEDINGS{huber2020a,
94+ title = {{CREMA}: a {J}ava library for credal network inference},
95+ editor = {Jaeger, M. and Nielsen, T.D.},
96+ publisher = {PMLR},
97+ address = {Aalborg, Denmark},
98+ series = {Proceedings of Machine Learning Research},
99+ booktitle = {Proceedings of the 10th International Conference on Probabilistic Graphical Models ({PGM} 2020)},
100+ author = {Huber, D. and Caba\~nas, R. and Antonucci, A. and Zaffalon, M.},
101+ year = {2020},
102+ url = {https://pgm2020.cs.aau.dk}
103+ }
104+ ```
0 commit comments