Modified limitedEventBuffer to send in linear delay
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user