()
| 14 | |
| 15 | public class TestLogM extends TestCase { |
| 16 | public void testMH() { |
| 17 | final double[][] dat = { |
| 18 | /// x1 x2 y |
| 19 | { 1, 0, 1 }, |
| 20 | { 1, 1, 1 }, |
| 21 | { 0, 1, 0 } |
| 22 | }; |
| 23 | final RExample ex = new RExample(dat); |
| 24 | final VectorFn sl = new DataFn<ExampleRow>(new SigmoidLossMultinomial(ex.dim,2),ex); |
| 25 | final double[] x0 = new double[sl.dim()]; |
| 26 | for(int i=0;i<sl.dim();++i) { |
| 27 | x0[i] = i+1; |
| 28 | } |
| 29 | TestOpt.testGradAndHessian(sl,x0,1.0e-5,1.0e-2); // very sensitive to epsilon |
| 30 | } |
| 31 | |
| 32 | public void testMHR() { |
| 33 | final double[][] dat = { |
nothing calls this directly
no test coverage detected