MathUtils { public static double sigmoid(double t) { return 1.0 / (1.0 + Math.exp(-t)); } private  MathUtils(); static long binomialCoeff(int n, int k); static double logSumExp(double[] scores); static double logWeightedGeometricMean(double[] weights, double[] logScores); static double weightedArithmeticMean(double[] weights, double[] scores); static double weightedGeometricMean(double[] weights, double[] scores); static double weightedLogSumExp(double[] weights, double[] scores); static double logprob(double input); static double clamp(double input, double min, double max); static double sigmoid(double t);  }
@Test public void testSigmoid() { assertTrue(MathUtils.sigmoid(100.0) <= 1.0); assertTrue(MathUtils.sigmoid(100.0) >= 0.0); assertEquals(0.5, MathUtils.sigmoid(0.0), 0.001); assertTrue(MathUtils.sigmoid(-100.0) >= 0.0); assertTrue(MathUtils.sigmoid(-100.0) <= 1.0); }