Calculate the negative log-likelihood of MRF model
mrf.nll(par, crf, instances, infer.method = infer.chain, ...)
The parameter vector of CRF
The CRF
The training data matrix of MRF model
The inference method used to compute the likelihood
Extra parameters need by the inference method
This function will return the value of MRF negative log-likilihood.
This function calculates the negative log-likelihood of MRF model as well as
the gradient. This function is intended to be called by optimization algorithm
in training process. Before calling this function, the MRF sufficient
statistics must be calculated and stored in object par.stat
of CRF.
In the training data matrix instances
, each row is an instance and
each column corresponds a node in CRF.