| Total Complexity | 5 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class BinaryStep implements ActivationFunction |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @param float|int $value |
||
| 13 | */ |
||
| 14 | public function compute($value): float |
||
| 15 | { |
||
| 16 | return $value >= 0 ? 1.0 : 0.0; |
||
| 17 | } |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @param float|int $value |
||
| 21 | * @param float|int $computedvalue |
||
| 22 | */ |
||
| 23 | public function differentiate($value, $computedvalue): float |
||
| 30 | } |
||
| 31 | } |
||
| 32 |