Wiki
linter / quality (push) Successful in 5m1s
tests / ci (8.4) (push) Successful in 5m8s
tests / ci (8.5) (push) Successful in 6m31s

This commit is contained in:
2026-09-15 19:44:58 +02:00
parent ca6c9fe38c
commit 6d4fdffee9
82 changed files with 29906 additions and 151 deletions
@@ -24,18 +24,20 @@ class IterationEventBufferTest extends TestCase
});
}
public function test_limited_buffer_discards_non_selected_epochs(): void
public function test_limited_buffer_sends_the_latest_non_selected_epoch_on_final_flush(): void
{
Event::fake();
$buffer = new PerceptronLimitedEpochEventBuffer('session', 'training', 2);
$buffer->addIteration(1, 0, 0.5, []);
$buffer->addIteration(2, 0, 0.25, []);
$buffer->addIteration(2, 1, 0.125, []);
$buffer->flush();
Event::assertDispatchedTimes(PerceptronTrainingIteration::class, 2);
Event::assertDispatched(PerceptronTrainingIteration::class, function (PerceptronTrainingIteration $event): bool {
return count($event->iterations) === 1
&& $event->iterations[0]['epoch'] === 1;
return count($event->iterations) === 2
&& $event->iterations[0]['epoch'] === 2;
});
}