Due: Friday, September 10, 2010, 9:30am
Reading: K&F Chapters 1, 2, 3.1-3.3.2, A.3
Written Exercises: 2.3, 2.5, 2.9, 2.10, 3.1, 3.2, 3.6, 3.7 (optional), 3.8 (optional), 3.9
Programming Exercises: For programming exercises, assume that the input is a binary adjacency matrix for a graph with
nodes.
Submission instructions and a sample graph and the resulting outputs will be posted here in the near future.
Due: Monday, October 4, 2010, 9:30am
Reading: K&F Chapters 3-5, 7
Written Exercises: 4.1, 4.2, 4.3, 4.5, 4.10, 4.15, 5.1 (extra credit), 5.2 (extra credit), 5.7, 5.12, 7.2
Programming Exercises:
Due: Monday, November 1, 2010, 9:30am
Reading: K&F Chapters: 8, 16, 17, 18, 20
Written Exercises: 7.7 (be sure to check the errata and errata, especially if you have the first printing!)
Programming Exercises:
Due Monday, November 22, 2010, 9:30am
Reading: K&F Chapters 9, 10, 11
Programming Exercises:
The goal of the homework is to implement exact inference for a positive Markov random field. Assume that you are given positive factors for a positive Gibbs distribution.
Box 10.A and Algorithm 10.A.1 can come handy in implementation.
All four archives contain the file with the factor specification, output file with the marginal probabilities for single variables, and the first three contain intermediate results (adjacency matrix for the Markov network, maximum cardinality ordering, cliques obtained from variable elimination along the maximum cardinality ordering, and the resulting clique tree). pgmExactInference.m contains a high-level script for a potential solution.
For gibbs10 network, gibbs10.zip also contains a file with an output of running pgmExactInference.m on the supplied Gibbs factors:
pgmExactInference('gibbs10.txt',[3 2 1 nan nan nan nan nan nan nan]));
The file with factor specification has the following format:
<number of variables> <cardinality for var 1> <cardinality for var 2> ... <cardinality for var d> <number of factors> <number if vars in factor 1> <var 1 in factor 1> <var 2 in factor 1> ... <var d_1 in factor 1> <value 1 for factor 1> <value 2 for factor 1> ... <value |factor 1| for factor 1> ... <number of vars in factor F> <var 1 in factor F> <var 2 in factor F> ... <var d_F in factor F> <value 1 for factor F> <value 2 for factor 1> ... <value |factor 1| for factor F>
For example, file gibbs4.txt contains the following:
4 2 2 2 2 4 2 1 2 1 2 3 4 2 1 4 4 3 2 1 2 2 3 3 2 1 4 2 3 4 1 1 1 1
There are 4 variables (assume ), each takes on 2 values (assume the values are {0,1}). There are 4 factors:
| | | |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 2 |
| 1 | 0 | 3 |
| 1 | 1 | 4 |
| | | |
|---|---|---|
| 0 | 0 | 4 |
| 0 | 1 | 3 |
| 1 | 0 | 2 |
| 1 | 1 | 1 |
| | | |
|---|---|---|
| 0 | 0 | 3 |
| 0 | 1 | 2 |
| 1 | 0 | 1 |
| 1 | 1 | 4 |
| | | |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |