Some bugfixes and misc
This commit is contained in:
@@ -38,4 +38,22 @@ class IterationEventBufferTest extends TestCase
|
||||
&& $event->iterations[0]['epoch'] === 1;
|
||||
});
|
||||
}
|
||||
|
||||
public function test_non_finite_values_are_normalized_before_broadcasting(): void
|
||||
{
|
||||
$event = new PerceptronTrainingIteration([
|
||||
[
|
||||
'epoch' => 1,
|
||||
'exampleIndex' => 0,
|
||||
'error' => NAN,
|
||||
'weights' => [[[INF]]],
|
||||
],
|
||||
], 'session', 'training');
|
||||
|
||||
$payload = $event->broadcastWith();
|
||||
|
||||
$this->assertNull($payload['iterations'][0]['error']);
|
||||
$this->assertNull($payload['iterations'][0]['weights'][0][0][0]);
|
||||
$this->assertJson(json_encode($payload, JSON_THROW_ON_ERROR));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user