()
| 30 | } |
| 31 | |
| 32 | public void testMHR() { |
| 33 | final double[][] dat = { |
| 34 | /// x1 x2 y |
| 35 | { 1, 0, 1 }, |
| 36 | { 1, 1, 1 }, |
| 37 | { 0, 1, 0 } |
| 38 | }; |
| 39 | final RExample ex = new RExample(dat); |
| 40 | final VectorFn sl = NormPenalty.addPenalty(new DataFn<ExampleRow>(new SigmoidLossMultinomial(ex.dim,2),ex),0.1,null); |
| 41 | final double[] x0 = new double[sl.dim()]; |
| 42 | for(int i=0;i<sl.dim();++i) { |
| 43 | x0[i] = i+1; |
| 44 | } |
| 45 | TestOpt.testGradAndHessian(sl,x0,1.0e-5,1.0e-2); // very sensitive to epsilon |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * chosen to run to infinity |
nothing calls this directly
no test coverage detected