@@ -35,7 +35,7 @@ public static function computeProvider() : Generator
35
35
[2.0 , 1.0 , -0.5 , 0.0 , 20.0 , -10.0 ],
36
36
]),
37
37
[
38
- [2.0 , 1.0 , -0.004999999888241291 , 0.0 , 20.0 , -0.09999999403953552 ],
38
+ [2.0 , 1.0 , -0.0049999 , 0.0 , 20.0 , -0.0999999 ],
39
39
],
40
40
];
41
41
@@ -46,9 +46,9 @@ public static function computeProvider() : Generator
46
46
[0.05 , -0.52 , 0.54 ],
47
47
]),
48
48
[
49
- [-0.0011999999405816197 , 0.3100000023841858 , -0.004900000058114529 ],
50
- [0.9900000095367432 , 0.07999999821186066 , -0.00029999998514540493 ],
51
- [0.05000000074505806 , -0.005199999548494816 , 0.5400000214576721 ],
49
+ [-0.0011999 , 0.3100000 , -0.0049000 ],
50
+ [0.9900000 , 0.0799999 , -0.0002999 ],
51
+ [0.0500000 , -0.0051999 , 0.5400000 ],
52
52
],
53
53
];
54
54
}
@@ -60,10 +60,10 @@ public static function differentiateProvider() : Generator
60
60
{
61
61
yield [
62
62
NumPower::array ([
63
- [2.0 , 1.0 , -0.5 , 0.0 , 20.0 , -10.0 ],
63
+ [4.0 , 2.0 , 1.0 , -0.5 , 0.0 , 20.0 , -10.0 ],
64
64
]),
65
65
[
66
- [1.0 , 1.0 , 0.009999999776482582 , 0.009999999776482582 , 1.0 , 0.009999999776482582 ],
66
+ [1.0 , 1.0 , 1.0 , 0.0099999 , 0.0099999 , 1.0 , 0.0099999 ],
67
67
],
68
68
];
69
69
@@ -74,9 +74,9 @@ public static function differentiateProvider() : Generator
74
74
[0.05 , -0.52 , 0.54 ],
75
75
]),
76
76
[
77
- [0.009999999776482582 , 1.0 , 0.009999999776482582 ],
78
- [1.0 , 1.0 , 0.009999999776482582 ],
79
- [1.0 , 0.009999999776482582 , 1.0 ],
77
+ [0.0099999 , 1.0 , 0.0099999 ],
78
+ [1.0 , 1.0 , 0.0099999 ],
79
+ [1.0 , 0.0099999 , 1.0 ],
80
80
],
81
81
];
82
82
}
@@ -113,7 +113,7 @@ public static function boundaryProvider() : Generator
113
113
]),
114
114
[
115
115
116
- [0.0010000000474974513 , -0.000010000000656873453 , 0.00009999999747378752 , -0.0000009999999974752427 ],
116
+ [0.0010000 , -0.0000100 , 0.0000999 , -0.0000009 ],
117
117
],
118
118
];
119
119
}
@@ -161,7 +161,7 @@ public function testActivate(NDArray $input, array $expected) : void
161
161
{
162
162
$ activations = $ this ->activationFn ->activate ($ input )->toArray ();
163
163
164
- static ::assertEqualsWithDelta ($ expected , $ activations , 1e-16 );
164
+ static ::assertEqualsWithDelta ($ expected , $ activations , 1e-7 );
165
165
}
166
166
167
167
#[Test]
@@ -171,16 +171,16 @@ public function testBoundaryActivate(NDArray $input, array $expected) : void
171
171
{
172
172
$ activations = $ this ->activationFn ->activate ($ input )->toArray ();
173
173
174
- static ::assertEqualsWithDelta ($ expected , $ activations , 1e-16 );
174
+ static ::assertEqualsWithDelta ($ expected , $ activations , 1e-7 );
175
175
}
176
176
177
177
#[Test]
178
- #[TestDox('Correctly differentiates the output ' )]
178
+ #[TestDox('Correctly differentiates the input ' )]
179
179
#[DataProvider('differentiateProvider ' )]
180
- public function testDifferentiate (NDArray $ output , array $ expected ) : void
180
+ public function testDifferentiate (NDArray $ input , array $ expected ) : void
181
181
{
182
- $ derivatives = $ this ->activationFn ->differentiate ($ output )->toArray ();
182
+ $ derivatives = $ this ->activationFn ->differentiate ($ input )->toArray ();
183
183
184
- static ::assertEqualsWithDelta ($ expected , $ derivatives , 1e-16 );
184
+ static ::assertEqualsWithDelta ($ expected , $ derivatives , 1e-7 );
185
185
}
186
186
}
0 commit comments