@Test
public void testGradientAtNonInitialPoint() throws IOException {
// given
RealValueFileEventStream rvfes1 = new RealValueFileEventStream(
"src/test/resources/data/opennlp/maxent/real-valued-weights-training-data.txt", "UTF-8");
DataIndexer testDataIndexer = new OnePassRealValueDataIndexer(rvfes1,1);
NegLogLikelihood objectFunction = new NegLogLikelihood(testDataIndexer);
// when
double[] nonInitialPoint = new double[] { 0.2, 0.5, 0.2, 0.5, 0.2, 0.5, 0.2, 0.5, 0.2, 0.5 };
double[] gradientAtNonInitialPoint =
objectFunction.gradientAt(dealignDoubleArrayForTestData(nonInitialPoint,
testDataIndexer.getPredLabels(),
testDataIndexer.getOutcomeLabels()));
double[] expectedGradient =
new double[] { -12.755042847945553, -21.227127506102434,
-72.57790706276435, 38.03525795198456,
15.348650889354925, 12.755042847945557,
21.22712750610244, 72.57790706276438,