* Test method for {@link com.neuralnetwork
* .shared.functions.LinearFunction#LinearFunction()}.
*/
@Test
public final void testLinearFunction() {
LinearFunction f = new LinearFunction();
assertNotNull(f);
for (int i = 0; i < NUM_ITER; i++) {
assertEquals(f.activate(i), i, ACCUR * Math.ulp(i));
assertEquals(f.derivative(i), 1, ACCUR * Math.ulp(i));
}
f.changeFunction(FunctionType.NULL);
for (int i = 0; i < NUM_ITER; i++) {
assertEquals(f.activate(i), 0, ACCUR * Math.ulp(i));
assertEquals(f.derivative(i), 0, ACCUR * Math.ulp(i));
}
}