else corefIndex = noIndex; constraints[documentIndex].rowPlusEquals (corefIndex, vec, 1.0); constraints[documentIndex].plusEquals (corefIndex, defaultFeatureIndex, 1.0); Mention ref = p.getReferent(); int corefIndex = clustering.inSameCluster(ant,ref) ? yesIndex : noIndex; expectations.rowPlusEquals (corefIndex, vec, 1.0); expectations.plusEquals (corefIndex, defaultFeatureIndex, 1.0); numPairs++; DenseVector v0 = super.getDenseVectorOf(0, constraints[docIndex]); DenseVector v1 = super.getDenseVectorOf(1, constraints[docIndex]); expectations.rowPlusEquals (0, v0, 1.0); expectations.rowPlusEquals (1, v1, 1.0); avgDifferences.rowPlusEquals (0, e0, 1.0); avgDifferences.rowPlusEquals (1, e1, 1.0); avgDifferences.timesEquals (1.0/(double)(epoch + 1)); lambdas.rowPlusEquals (0, avg0, 1.0); lambdas.rowPlusEquals (1, avg1, 1.0);
else corefIndex = noIndex; constraints[documentIndex].rowPlusEquals (corefIndex, vec, 1.0); constraints[documentIndex].plusEquals (corefIndex, defaultFeatureIndex, 1.0); Mention ref = p.getReferent(); int corefIndex = clustering.inSameCluster(ant,ref) ? yesIndex : noIndex; expectations.rowPlusEquals (corefIndex, vec, 1.0); expectations.plusEquals (corefIndex, defaultFeatureIndex, 1.0); numPairs++; DenseVector v0 = getDenseVectorOf(0, constraints[docIndex]); DenseVector v1 = getDenseVectorOf(1, constraints[docIndex]); expectations.rowPlusEquals (0, v0, 1.0); expectations.rowPlusEquals (1, v1, 1.0); DenseVector e0 = getDenseVectorOf(0, expectations); DenseVector e1 = getDenseVectorOf(1, expectations); lambdas.rowPlusEquals (0, e0, 1.0); lambdas.rowPlusEquals (1, e1, 1.0);
int ind; if (cl) ind = 1; else ind = 0; constraints.rowPlusEquals (ind, vec, 1.0); constraints.plusEquals (ind, defaultFeatureIndex, 1.0); // dummy int ind; if (cl.inSameCluster(curPart, c1, c2)) ind = 1; else ind = 0; expectations.rowPlusEquals (ind, v, 1.0); expectations.plusEquals (ind, defaultFeatureIndex, 1.0); v1.print(); expectations.rowPlusEquals (0, v0, 1.0); expectations.rowPlusEquals (1, v1, 1.0); DenseVector e0 = getDenseVectorOf(0, expectations); DenseVector e1 = getDenseVectorOf(1, expectations); e1.print(); lambdas.rowPlusEquals (0, e0, 1.0); lambdas.rowPlusEquals (1, e1, 1.0); System.out.println("Parameters at iteration: " + epoch); lambdas.print();