Modified limitedEventBuffer to send in linear delay

This commit is contained in:
2026-03-23 16:00:51 +01:00
parent 236fa503fb
commit dea908c63e
2 changed files with 4 additions and 12 deletions

View File

@@ -32,20 +32,12 @@ class PerceptronLimitedEpochEventBuffer implements IPerceptronIterationEventBuff
'weights' => $synaptic_weights, '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; $lastEpoch = $this->data[0]['epoch'] ?? null;
if ($this->data && $lastEpoch !== $epoch) { // Current Epoch has changed from the last one 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 $this->flush(); // Flush all data from the previous epoch
} else { } else {
$this->data = []; $this->data = []; // We clear the data without sending it as we are saving the next epoch data
} }
$lastEpoch = $epoch; $lastEpoch = $epoch;

View File

@@ -7,12 +7,12 @@ return [
* Beyond this number of iterations, the broadcast will be splitted every x iterations, * Beyond this number of iterations, the broadcast will be splitted every x iterations,
* x is limited_broadcast_number * x is limited_broadcast_number
*/ */
'limited_broadcast_iterations' => 200, 'limited_broadcast_iterations' => 100,
/** /**
* How much broadcasts is sent when in limmited broadcast mode * How much broadcasts is sent when in limmited broadcast mode
*/ */
'limited_broadcast_number' => 200, 'limited_broadcast_number' => 100,
'broadcast_iteration_size' => 75, 'broadcast_iteration_size' => 75,