Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
rrtucci committed Feb 20, 2017
1 parent 3984ed0 commit 2745314
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 61 deletions.
54 changes: 27 additions & 27 deletions examples_cbnets/HuaDar1.bif
@@ -1,15 +1,9 @@
network unknown {

variable G {
type discrete [ 2 ] {state0, state1};
}
variable D {
type discrete [ 2 ] {state0, state1};
}
variable F {
type discrete [ 2 ] {state0, state1};
}
variable E {
variable H {
type discrete [ 2 ] {state0, state1};
}
variable B {
Expand All @@ -18,29 +12,27 @@ type discrete [ 2 ] {state0, state1};
variable A {
type discrete [ 2 ] {state0, state1};
}
variable C {
variable E {
type discrete [ 2 ] {state0, state1};
}
variable H {
variable G {
type discrete [ 2 ] {state0, state1};
}
probability ( G | C ) {
(state0) 0.1, 0.9;
(state1) 0.8, 0.2;
variable F {
type discrete [ 2 ] {state0, state1};
}
variable C {
type discrete [ 2 ] {state0, state1};
}
probability ( D | B ) {
(state0) 0.5, 0.5;
(state1) 0.9, 0.1;
}
probability ( F | D, E ) {
(state0, state0) 0.99, 0.01;
(state0, state1) 0.01, 0.99;
(state1, state0) 0.01, 0.99;
(state1, state1) 0.01, 0.99;
}
probability ( E | C ) {
(state0) 0.6, 0.4;
(state1) 0.3, 0.7;
probability ( H | E, G ) {
(state0, state0) 0.95, 0.05;
(state0, state1) 0.95, 0.05;
(state1, state0) 0.95, 0.05;
(state1, state1) 0.05, 0.95;
}
probability ( B | A ) {
(state0) 0.4, 0.6;
Expand All @@ -49,14 +41,22 @@ probability ( B | A ) {
probability ( A ) {
table 0.5, 0.5;
}
probability ( E | C ) {
(state0) 0.6, 0.4;
(state1) 0.3, 0.7;
}
probability ( G | C ) {
(state0) 0.1, 0.9;
(state1) 0.8, 0.2;
}
probability ( F | D, E ) {
(state0, state0) 0.99, 0.01;
(state1, state0) 0.01, 0.99;
(state0, state1) 0.01, 0.99;
(state1, state1) 0.01, 0.99;
}
probability ( C | A ) {
(state0) 0.2, 0.8;
(state1) 0.7, 0.3;
}
probability ( H | E, G ) {
(state0, state0) 0.95, 0.05;
(state1, state0) 0.95, 0.05;
(state0, state1) 0.95, 0.05;
(state1, state1) 0.05, 0.95;
}
}
28 changes: 18 additions & 10 deletions examples_cbnets/dot_test1.dot
@@ -1,11 +1,19 @@
strict graph G {
p2;
center;
p1;
c1;
c2;
p2 -- center;
center -- c2;
center -- p1;
center -- c1;
strict digraph G {
D;
B;
C;
A;
E;
G;
F;
H;
D -> F;
B -> D;
C -> E;
C -> G;
A -> C;
A -> B;
E -> F;
E -> H;
G -> H;
}
28 changes: 18 additions & 10 deletions examples_cbnets/dot_test2.dot
@@ -1,11 +1,19 @@
strict graph G {
p2;
center;
p1;
c1;
c2;
p2 -- center;
center -- c2;
center -- p1;
center -- c1;
strict digraph G {
C;
D;
B;
A;
E;
G;
F;
H;
C -> E;
C -> G;
D -> F;
B -> D;
A -> C;
A -> B;
E -> F;
E -> H;
G -> H;
}
26 changes: 13 additions & 13 deletions examples_qbnets/QuWetGrass1.bif
@@ -1,17 +1,26 @@
network unknown {

variable Rain {
variable Cloudy {
type discrete [ 2 ] {state0, state1};
}
variable Sprinkler {
variable WetGrass {
type discrete [ 2 ] {state0, state1};
}
variable WetGrass {
variable Rain {
type discrete [ 2 ] {state0, state1};
}
variable Cloudy {
variable Sprinkler {
type discrete [ 2 ] {state0, state1};
}
probability ( Cloudy ) {
table 0.70014+0.140028j, 0.70014+0.j ;
}
probability ( WetGrass | Sprinkler, Rain ) {
(state0, state0) 0.999898+0.j , 0.010100-0.0101j;
(state1, state0) 0.0039936+0.j , 0.3953616+0.9185169j;
(state0, state1) 0.0019619-0.9809543j, 0.1942289+0.j ;
(state1, state1) 0.0071063+0.7106332j, 0.7035268+0.j ;
}
probability ( Rain | Cloudy ) {
(state0) 0.3980149+0.j , 0.5970223-0.696526j;
(state1) 0.6454972-0.1290994j, 0.6454972+0.3872983j;
Expand All @@ -20,13 +29,4 @@ probability ( Sprinkler | Cloudy ) {
(state0) 0.2073903+0.5184758j, 0.8295614+0.j ;
(state1) 0.2152064+0.9223132j, 0.0922313-0.3074377j;
}
probability ( WetGrass | Sprinkler, Rain ) {
(state0, state0) 0.999898+0.j , 0.010100-0.0101j;
(state0, state1) 0.0039936+0.j , 0.3953616+0.9185169j;
(state1, state0) 0.0019619-0.9809543j, 0.1942289+0.j ;
(state1, state1) 0.0071063+0.7106332j, 0.7035268+0.j ;
}
probability ( Cloudy ) {
table 0.70014+0.140028j, 0.70014+0.j ;
}
}
2 changes: 1 addition & 1 deletion graphs/BayesNet.py
Expand Up @@ -6,7 +6,7 @@
import pandas as pd

from graphs.Dag import *
# from nodes.BayesNode import *
from nodes.BayesNode import *
from BifTool import *
from potentials.DiscreteUniPot import *

Expand Down

0 comments on commit 2745314

Please sign in to comment.