clamp.reset {CRF} | R Documentation |
Reset clamped CRF by changing the states of clamped nodes
clamp.reset(crf, clamped)
crf |
The clamped CRF generated by |
clamped |
The vector of fixed states of nodes |
The function will reset a clamped CRF by changing the states of fixed nodes.
The vector clamped
contains the desired state for each node
while zero means the state is not fixed. The node and edge potentials are
updated to the conditional potentials based on the clamped vector.
The function will return the same clamped CRF.
library(CRF)
data(Small)
crf <- clamp.crf(Small$crf, c(0, 0, 1, 1))
clamp.reset(crf, c(0,0,2,2))