compute($value)); } public function binaryStepProvider(): array { return [ [1, 1], [1, 0], [0, -0.1], ]; } /** * @dataProvider binaryStepDerivativeProvider * * @param float|int $value */ public function testBinaryStepDerivative(float $expected, $value): void { $binaryStep = new BinaryStep(); $activatedValue = $binaryStep->compute($value); self::assertEquals($expected, $binaryStep->differentiate($value, $activatedValue)); } public function binaryStepDerivativeProvider(): array { return [ [0, -1], [1, 0], [0, 1], ]; } }