Total Complexity | 4 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
5 | class Activation |
||
6 | { |
||
7 | /** |
||
8 | * @param float $input |
||
9 | * @return float |
||
10 | */ |
||
11 | public static function ReLU(float $input) : float |
||
12 | { |
||
13 | return max(0, $input); |
||
14 | } |
||
15 | |||
16 | /** |
||
17 | * @param float $input |
||
18 | * @return float |
||
19 | */ |
||
20 | public static function Sigmoid(float $input) : float |
||
21 | { |
||
22 | return round(1 / (1 + exp(-$input)), 4); |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * @param array $inputs |
||
27 | * @return array |
||
28 | */ |
||
29 | public static function Softmax(array $inputs) : array |
||
44 | } |
||
45 | } |