Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
friguzzi committed Jun 3, 2016
1 parent a510b22 commit 1c89583
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
6 changes: 2 additions & 4 deletions examples/inference/arithm.pl
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,9 @@

identity(_):0.5.

random_const(_,C):discrete(C,[0:0.1,1:0.1,2:0.1,3:0.1,4:0.1,
5:0.1,6:0.1,7:0.1,8:0.1,9:0.1]).

random_const(L,0):0.1;random_const(L,1):0.1;random_const(L,2):0.1;
random_const(L,3):0.1;random_const(L,4):0.1;random_const(L,5):0.1;
random_const(L,6):0.1;random_const(L,7):0.1;random_const(L,8):0.1;
random_const(L,9):0.1.



Expand Down
2 changes: 1 addition & 1 deletion examples/inference/kalman_filter.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
and the output is given by the current state plus Gaussian noise (mean
0 and variance 1 in this example).
This example can be considered as modeling a random walk of a single continuous
state variable with a noisy observation.
state variable with noisy observations.
Given that at time 0 the value 2.5 was
observed, what is the distribution of the state at time 1 (filtering problem)?
The distribution of the state is plotted in the case of having (posterior) or
Expand Down
22 changes: 10 additions & 12 deletions examples/inference/slp_pcfg.pl
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,20 @@
:- begin_lpad.

s_as(N):0.2;s_bs(N):0.2;s_a(N):0.3;s_b(N):0.3.
s([a|R],N0,N):-
s([a|R],N0):-
s_as(N0),
N1 is N0+1,
s(R,N1,N).
s([b|R],N0,N):-
s(R,N1).
s([b|R],N0):-
s_bs(N0),
N1 is N0+1,
s(R,N1,N).
s([a],N0,N):-
s_a(N0),
N is N0+1.
s([b],N0,N):-
s_b(N0),
N is N0+1.

s(L):-s(L,0,_).
s(R,N1).
s([a],N0):-
s_a(N0).
s([b],N0):-
s_b(N0).

s(L):-s(L,0).
:- end_lpad.

/** <examples>
Expand Down

0 comments on commit 1c89583

Please sign in to comment.