public CRFOptimizableByLabelLikelihood (CRF crf, InstanceList ilist) { // Set up this.crf = crf; this.trainingSet = ilist; //cachedGradient = new DenseVector (numParameters); cachedGradient = new double[crf.parameters.getNumFactors()]; constraints = new CRF.Factors(crf.parameters); expectations = new CRF.Factors(crf.parameters); // This resets and values that may have been in expectations and constraints //reallocateSufficientStatistics(); // This is unfortunately necessary, b/c cachedValue & cachedValueStale not in same place! cachedValueWeightsStamp = -1; cachedGradientWeightsStamp = -1; gatherConstraints (ilist); }
public CRFOptimizableByLabelLikelihood (CRF crf, InstanceList ilist) { // Set up this.crf = crf; this.trainingSet = ilist; //cachedGradient = new DenseVector (numParameters); cachedGradient = new double[crf.parameters.getNumFactors()]; constraints = new CRF.Factors(crf.parameters); expectations = new CRF.Factors(crf.parameters); // This resets and values that may have been in expectations and constraints //reallocateSufficientStatistics(); // This is unfortunately necessary, b/c cachedValue & cachedValueStale not in same place! cachedValueWeightsStamp = -1; cachedGradientWeightsStamp = -1; gatherConstraints (ilist); }
public CRFOptimizableByLabelLikelihood (CRF crf, InstanceList ilist) { // Set up this.crf = crf; this.trainingSet = ilist; //cachedGradient = new DenseVector (numParameters); cachedGradient = new double[crf.parameters.getNumFactors()]; constraints = new CRF.Factors(crf.parameters); expectations = new CRF.Factors(crf.parameters); // This resets and values that may have been in expectations and constraints //reallocateSufficientStatistics(); // This is unfortunately necessary, b/c cachedValue & cachedValueStale not in same place! cachedValueWeightsStamp = -1; cachedGradientWeightsStamp = -1; gatherConstraints (ilist); }