#include <Random_Field.hpp>
Inheritance diagram for Random_Field:
Public Member Functions | |
virtual | ~Random_Field () |
Destructor. | |
void | Fix () |
no parameter estimation | |
virtual uint | Get_K () |
Get the number of classess/colors ... | |
uint | Get_N () |
Get the number of sites. | |
virtual double | H (uint i, uint k, vector< uint > const &Z) |
Hamiltonian. | |
virtual double | Hmf (uint i, uint k) |
Mean-field hamiltonian, ![]() | |
void | Compute_PGmf (uint i, vector< double > &PG) |
Compute conditional probabilities given father class p and the neighbors Z. mean-field appoximation. | |
void | Compute_PGmf (vector< double > &PG) |
Compute conditional probabilities given father class p and the neighbors Z. mean-field appoximation. | |
void | Compute_PG (uint i, vector< uint > const &Z, vector< double > &PG) |
Compute class conditional probabilities at site i given upper class l and the neighbors Z. | |
void | Simulate (vector< uint > &Z) |
Simulate the Block_MRF, one iteration. Gibbs sampler. | |
void | Simulate (uint nbiter, vector< uint > &Z) |
Simulate the Block_MRF, Gibbs sampler. | |
void | Set_Zmf (vector< double > const &z) |
Set the mean-field neighborhood, ![]() | |
void | Set_Zmf (vector< double > const &z, uint i) |
Set the mean-field neighborhood at site ![]() | |
void | Get_Zmf (vector< double > &z) |
Get the mean-field neighborhood, ![]() | |
void | Set_Z (vector< uint > const &z) |
Set neighborhood ![]() | |
virtual void | Gradient (vector< double > const &tik, vector< double > &Q) |
Compute the gradient. | |
void | Gradient (vector< uint > const &Z, vector< double > &Q) |
Compute the gradient. | |
virtual void | Update_Gradient (vector< double > const &Q) |
Update model parameters in the gradient descent. | |
void | Init_Gradient_Descent () |
Initialize the gradient descent. | |
void | Finalize_Gradient_Descent () |
Finalize the gradient descent. | |
void | Set_Gradient (double step, double tol, uint maxiter) |
Set gradient descent parameters. | |
void | Update_Gradient_Step (vector< double > const &Qold, vector< double > const &Q) |
Update gradient step vector. | |
void | Gradient_Descent (vector< double > const &tik) |
Perform the gradient descent. | |
virtual void | Read_Params (istream &is) |
Read the model parameters from the stream is. | |
virtual void | Write_Params (ostream &os) |
Write the model parameters to the stream os. | |
void | Estimate (vector< double > const &tik) |
Estimate parameters given fuzzy classification. | |
void | Estimate (vector< uint > const &Z) |
Estimate parameters given hard classification. | |
virtual uint | Degrees_Of_Freedom () |
Number of free parameters. | |
virtual void | Info () |
Print some info on the model. | |
Protected Member Functions | |
virtual void | Precompute_Smf () |
Precompute mean-field sums of Z (for the gradient algo.). | |
Protected Attributes | |
Neighborhood_System * | NHS |
Underlying neighborhood system. | |
vector< double > | Z_mf |
Mean field neighborhood ![]() | |
vector< double > | S_mf |
sums of all neighbors of a given class | |
bool | precomputed_smf |
true if the sums have been precomputed. | |
bool | fix |
true if Gamma has to be estimated. | |
double | gradient_tol |
tolerence of the gradient algorithm. lower limit for gradient norm. | |
uint | gradient_maxiter |
maximum number of iterations for the gradient algorithm. | |
vector< double > | gradient_step |
step vector for gradient descent |
|
Destructor. |
|
Compute the conditional probabilities: |
|
Compute
|
|
Estimate the parameters given the state
|
|
Estimate the parameters given the fuzzy classification
|
|
Get the total number of classes
Reimplemented in MRF. |
|
Get the number of sites.
|
|
Computes the gradient given current Random_Field state.
|
|
Computes the gradient given the fuzzy classification.
Reimplemented in External_Potts, Generic_Potts, MRF, and Potts. |
|
Performs a gradient descent to estimate model parameters.
|
|
Compute the Hamiltonian
Reimplemented in External_Potts, Generic_Potts, MRF, and Potts. |
|
Compute the Hamiltonian mean-field approximation, given
Reimplemented in External_Potts, Generic_Potts, MRF, and Potts. |
|
Print some info on the model. Reimplemented in External_Potts, Generic_Potts, MRF, and Potts. |
|
Precompute S_mf_i= {j N_i} Zmf_{jk}, i, k This quantity does not change during the EM steps of the NR-EM algorithm. Reimplemented in MRF. |
|
Read the model parameters from the stream is. Reimplemented in External_Potts, Generic_Potts, MRF, and Potts. |
|
Set the mean-field neighborhood, given Random_Field current state
|
|
Set the mean-field neighborhood,
|
|
Set the mean-field neighborhood,
|
|
Simulation algorithm. Gibbs Sampler. N iterations over all the sites.
|
|
Simulation algorithm. Gibbs Sampler. 1 iteration over all the sites.
|
|
Write the model parameters to the stream os. Reimplemented in External_Potts, Generic_Potts, MRF, and Potts. |