public void computeExpectations(FeatureVector input, double[] dist, double weight) { preProcess(input); for (int li = 0; li < numLabels; li++) { double p = weight * dist[li]; for (int i = 0; i < indexCache.size(); i++) { if (useValues) { constraints.get(indexCache.getQuick(i)).expectation[li] += p * valueCache.getQuick(i); } else { constraints.get(indexCache.getQuick(i)).expectation[li] += p; } } } }
public void computeExpectations(FeatureVector input, double[] dist, double weight) { preProcess(input); for (int li = 0; li < numLabels; li++) { double p = weight * dist[li]; for (int i = 0; i < indexCache.size(); i++) { if (useValues) { constraints.get(indexCache.getQuick(i)).expectation[li] += p * valueCache.getQuick(i); } else { constraints.get(indexCache.getQuick(i)).expectation[li] += p; } } } }
public void computeExpectations(FeatureVector input, double[] dist, double weight) { preProcess(input); for (int li = 0; li < numLabels; li++) { double p = weight * dist[li]; for (int i = 0; i < indexCache.size(); i++) { if (useValues) { constraints.get(indexCache.getQuick(i)).expectation[li] += p * valueCache.getQuick(i); } else { constraints.get(indexCache.getQuick(i)).expectation[li] += p; } } } }