Skip to content

Commit b7c198c

Browse files
committed
Add forward-backward markdown.
1 parent a543bd2 commit b7c198c

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ The file [aima3e-algorithms.pdf](https://github.com/aimacode/pseudocode/blob/mas
5959
| • | | [LIKELIHOOD-WEIGHTING](md/Likelihood-Weighting.md) |
6060
| • | | [GIBBS-ASK](md/Gibbs-Ask.md) |
6161
|<hr/>|<hr/>|<hr/>|
62+
| &bull; | | [FORWARD-BACKWARD](md/Forward-Backward.md) |
6263
| &bull; | | |
6364
|<hr/>|<hr/>|<hr/>|
6465
| &bull; | | |

md/Forward-Backward.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# FORWARD-BACKWARD
2+
3+
## AIMA3e
4+
__function__ FORWARD-BACKWARD(__ev__, _prior_) __returns__ a vector of probability distributions
5+
&emsp;__inputs__: __ev__, a vector of evidence values for steps 1,&hellip;,_t_
6+
&emsp;&emsp;&emsp;&emsp;&emsp;_prior_, the prior distribution on the initial state, __P__(__X__<sub>0</sub>)
7+
&emsp;__local variables__: __fv__, a vector of forward messages for steps 0,&hellip;,_t_
8+
&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;__b__, a representation of the backward message, initially all 1s
9+
&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;__sv__, a vector of smoothed estimates for steps 1,&hellip;,_t_
10+
11+
&emsp;__fv__\[0\] &larr; _prior_
12+
&emsp;__for__ _i_ = 1 __to__ _t_ __do__
13+
&emsp;&emsp;&emsp;__fv__\[_i_\] &larr; FORWARD(__fv__\[_i_ &minus; 1\], __ev__\[_i_\])
14+
&emsp;__for__ _i_ = _t_ __downto__ 1 __do__
15+
&emsp;&emsp;&emsp;__sv__\[_i_\] &larr; NORMALIZE(__fv__\[_i_\] &times; __b__)
16+
&emsp;&emsp;&emsp;__b__ &larr; BACKWARD(__b__, __ev__\[_i_\])
17+
&emsp;__return__ __sv__
18+
19+
---
20+
__Figure ??__ The forward\-backward algorithm for smoothing: computing posterior probabilities of a sequence of states given a sequence of observations. The FORWARD and BACKWARD operators are defined by Equations (__??__) and (__??__), respectively.

0 commit comments

Comments
 (0)