crf.nll: Calculate CRF negative log likelihood

Description Usage Arguments Details Value See Also

View source: R/train.R

Description

Calculate the negative log likelihood of CRF model

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
crf.nll(
  par,
  crf,
  instances,
  node.fea = NULL,
  edge.fea = NULL,
  node.ext = NULL,
  edge.ext = NULL,
  infer.method = infer.chain,
  ...
)

Arguments

par

The parameter vector of CRF

crf

The CRF

instances

The training data matrix of CRF model

node.fea

The list of node features

edge.fea

The list of edge features

node.ext

The list of extended information of node features

edge.ext

The list of extended information of edge features

infer.method

The inference method used to compute the likelihood

...

Extra parameters need by the inference method

Details

This function calculates the negative log likelihood of CRF model as well as the gradient. This function is intended to be called by optimization algorithm in training process.

In the training data matrix instances, each row is an instance and each column corresponds a node in CRF. The variables node.fea, edge.fea, node.ext, edge.ext are lists of length equal to the number of instances, and their elements are defined as in crf.update respectively.

Value

This function will return the value of CRF negative log-likelihood.

See Also

crf.update, train.crf


CRF documentation built on Dec. 1, 2019, 3:02 a.m.