calhoun.analysis.crf.solver
Class MaximumExpectedAccuracySemiMarkovGradient
java.lang.Object
calhoun.analysis.crf.solver.semimarkov.CleanMaximumLikelihoodSemiMarkovGradient
calhoun.analysis.crf.solver.semimarkov.CleanLocalScoreSemiMarkovGradient
calhoun.analysis.crf.solver.MaximumExpectedAccuracySemiMarkovGradient
- All Implemented Interfaces:
- CRFObjectiveFunctionGradient
public class MaximumExpectedAccuracySemiMarkovGradient
- extends CleanLocalScoreSemiMarkovGradient
computes an objective function which is the expected value of a local path similarity score on a
semi-Markov model. Requires a CacheProcessor and a LocalPathSimilarityScore to be configured.
Debugging output
To get a better understanding of what the objective function is doing, several different properties can be set that
cause the objective function to write out trace files showing its calculations during training. Usually when turning
these options on, you should set maxIters = 1 and requireConvergence = false in your optimizer
to do only a single training iteration, possibly setting the starts to some predetermined value. Each of these
properties can be configured with a filename and each time CleanLocalScoreSemiMarkovGradient.apply(double[], double[]) is called, the file will be overwritten with
data from the current call. The logging options are:
-
alphaFile - computation of alpha values for Markov states, includes all nodes and edges.
-
alphaLengthFile - computation of alpha values for semi-Markov states , includes all segments
-
betaLengthFile - computation of beta values for semi-Markov states , includes all segments
-
expectFile - computation of expected values for each Markov feature
-
expectLengthFile - computation of expected values for each semi-Markov feature
-
nodeMarginalFile - computation of marginal probability of each state at each position
Implementation Notes
The general normalization scheme works as follows. When updating alpha values in the forward pass we compute segments
of length 1 first and then work backwards.
Instead of always normalizing to 1 we discretize the normalization. We choose an arbitrary normalization factor w,
such as 50. The normalization factor at any position is then an integer v, and all entries at that position are
alpha[y]*e^(v*w).
The normalization can be computed at any position from 1) Elements of the alpha array are summed s 2) v = log(s)/w.
By integer division v will always be an appropriate normalizer. It may be positive or negative. 3) All elements of
the array are divided by e^(v*w)
| Methods inherited from class calhoun.analysis.crf.solver.semimarkov.CleanMaximumLikelihoodSemiMarkovGradient |
clean, getAlphaFile, getAlphaLengthFile, getBetaLengthFile, getCacheProcessor, getExpectFile, getExpectLengthFile, getNodeMarginalFile, printNorm, setAlphaFile, setAlphaLengthFile, setBetaLengthFile, setCacheProcessor, setExpectFile, setExpectLengthFile, setNodeMarginalFile |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MaximumExpectedAccuracySemiMarkovGradient
public MaximumExpectedAccuracySemiMarkovGradient()