Some bugfixes and misc
linter / quality (push) Successful in 4m24s
tests / ci (8.4) (push) Successful in 4m47s
tests / ci (8.5) (push) Successful in 5m0s

This commit is contained in:
2026-09-08 20:01:52 +02:00
parent 0e177f8491
commit 69e683bcaf
13 changed files with 120 additions and 33 deletions
@@ -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));
}
}