@@ -24,36 +24,33 @@ public class Starting {
24
24
/* CN defined with vertex Factor */
25
25
26
26
// 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 );
29
29
int B = model. addVariable(2 );
30
+
30
31
model. addParent(B ,A );
31
32
32
33
// Define a credal set of the partent node
33
34
VertexFactor fu = new VertexFactor (model. getDomain(A ), Strides . empty());
34
35
fu. addVertex(new double []{0. , 1 - p, p});
35
36
fu. addVertex(new double []{1 - p, 0. , p});
37
+
36
38
model. setFactor(A ,fu);
37
39
38
40
39
41
// Define the credal set of the child
40
42
VertexFactor fx = new VertexFactor (model. getDomain(B ), model. getDomain(A ));
41
-
42
43
fx. addVertex(new double []{1. , 0. ,}, 0 );
43
44
fx. addVertex(new double []{1. , 0. ,}, 1 );
44
45
fx. addVertex(new double []{0. , 1. ,}, 2 );
45
46
46
47
model. setFactor(B ,fx);
47
48
48
49
// Run exact inference
49
- CredalVariableElimination inf = new CredalVariableElimination (model);
50
+ CredalVariableElimination< VertexFactor > inf = new CredalVariableElimination<> (model);
50
51
inf. query(A , ObservationBuilder . observe(B ,0 ));
51
-
52
52
}
53
53
}
54
-
55
-
56
-
57
54
```
58
55
59
56
## Installation
@@ -76,4 +73,32 @@ Add the following code in the pom.xml of your project:
76
73
<scope >compile</scope >
77
74
</dependency >
78
75
</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