Home > MRFLearning > MLgrid.m

Estimate the ML parameters for a rectangular grid boltzmann m/c, using the junction tree algorithm for exact inference Inputs: data : (#samples X #nodes) matrix containing training samples Each node can take values from {+1,-1} or {0,1} R : # rows in the grid C : # columns in the grid Returns: model: struct with fields numRows: R numCols: C alpha : (R X C) matrix of node biases (ML estimates) wHor : (R X C-1) matrix of horizontal edge weights (ML estimates) wVer : (R-1 X C) matrix of vertical edge weights (ML estimates) Optionally saves a file "paramVec.mat" showing the sequence of updates to the parameters The node value representation ( +1/-1 or 0/1) intended by the user is guessed from the training samples. If using -1/+1, the data is first mapped to 0/1 and the model params are learned. These learned params are then mapped back to the -1/1 case. If the variable MONITOR is set to 1 on line <51>, a file "paramVec.mat" is generated that saves the parameter updates. One can plot these values to see if the gradient learning parmeters (MAX_ITERATIONS, EPSILON1, rho) are reasonable. If not they can be changed on lines <48-50> Stopping criterion for gradient ascent: at each iteration, the learning rate (rho) is increased if log-likelihood increases (rho=1.1*rho) and decreased otherwise (rho=0.5*rho). Stops when either MAX_ITERATIONS is reached or maximum change across all parameters is less than EPSILON1

- findGridMarginals Node and Edge Marginals for a grid from JT output
- getNeighbors Get neighbors of each node in an (R X C) grid
- runJTgrid Junction Tree Inference for a rectangular grid Boltzmann m/c

Generated on Wed 28-Sep-2005 04:10:02 by