LogLikelihoodFunction implements DifferentiableFunction { public double[] getInitialPoint() { return new double[domainDimension]; } LogLikelihoodFunction(DataIndexer indexer); double valueAt(double[] x); double[] gradientAt(double[] x); int getDomainDimension(); double[] getInitialPoint(); String[] getPredLabels(); String[] getOutcomeLabels(); int[][] getOutcomePatterns();  }
@Test public void testInitialSanity() throws IOException { RealValueFileEventStream rvfes1 = new RealValueFileEventStream("src/test/resources/data/opennlp/maxent/real-valued-weights-training-data.txt", "UTF-8"); DataIndexer testDataIndexer = new OnePassRealValueDataIndexer(rvfes1,1); LogLikelihoodFunction objectFunction = new LogLikelihoodFunction(testDataIndexer); double[] initial = objectFunction.getInitialPoint(); for (int i = 0; i < initial.length; i++) { assertEquals(0.0, initial[i], TOLERANCE01); } }