From dea908c63edd6907e66665601ce6f166b7a0ca5b Mon Sep 17 00:00:00 2001 From: Matthias Guillitte Date: Mon, 23 Mar 2026 16:00:51 +0100 Subject: [PATCH] Modified limitedEventBuffer to send in linear delay --- .../PerceptronLimitedEpochEventBuffer.php | 12 ++---------- config/perceptron.php | 4 ++-- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/app/Services/IterationEventBuffer/PerceptronLimitedEpochEventBuffer.php b/app/Services/IterationEventBuffer/PerceptronLimitedEpochEventBuffer.php index c52b06d..88fcac9 100644 --- a/app/Services/IterationEventBuffer/PerceptronLimitedEpochEventBuffer.php +++ b/app/Services/IterationEventBuffer/PerceptronLimitedEpochEventBuffer.php @@ -32,20 +32,12 @@ class PerceptronLimitedEpochEventBuffer implements IPerceptronIterationEventBuff 'weights' => $synaptic_weights, ]; - if ($this->underSizeIncreaseCount <= $this->sizeIncreaseStart) { // Special case where we need to send each iteration separately - $this->underSizeIncreaseCount++; - $this->data[] = $newData; - $this->flush(); - - return; - } - $lastEpoch = $this->data[0]['epoch'] ?? null; if ($this->data && $lastEpoch !== $epoch) { // Current Epoch has changed from the last one - if ($lastEpoch % $this->epochInterval === 0) { // The last epoch need to be sent + if ($lastEpoch == 1 || $lastEpoch % $this->epochInterval === 0) { // The last saved epoch need to be sent $this->flush(); // Flush all data from the previous epoch } else { - $this->data = []; + $this->data = []; // We clear the data without sending it as we are saving the next epoch data } $lastEpoch = $epoch; diff --git a/config/perceptron.php b/config/perceptron.php index 08841a5..631d39c 100644 --- a/config/perceptron.php +++ b/config/perceptron.php @@ -7,12 +7,12 @@ return [ * Beyond this number of iterations, the broadcast will be splitted every x iterations, * x is limited_broadcast_number */ - 'limited_broadcast_iterations' => 200, + 'limited_broadcast_iterations' => 100, /** * How much broadcasts is sent when in limmited broadcast mode */ - 'limited_broadcast_number' => 200, + 'limited_broadcast_number' => 100, 'broadcast_iteration_size' => 75,