Refactored into folders

This commit is contained in:
2026-03-22 10:42:08 +01:00
parent 977c259cb9
commit 4717254da4
18 changed files with 258 additions and 44 deletions

View File

@@ -3,8 +3,8 @@
namespace App\Models;
use App\Events\PerceptronTrainingEnded;
use App\Services\DataSetReader;
use App\Services\IPerceptronIterationEventBuffer;
use App\Services\DatasetReader\IDataSetReader;
use App\Services\IterationEventBuffer\IPerceptronIterationEventBuffer;
abstract class NetworkTraining
{
@@ -17,7 +17,7 @@ abstract class NetworkTraining
public ActivationsFunctions $activationFunction;
public function __construct(
protected DataSetReader $datasetReader,
protected IDataSetReader $datasetReader,
protected int $maxEpochs,
protected IPerceptronIterationEventBuffer $iterationEventBuffer,
protected string $sessionId,
@@ -42,4 +42,11 @@ abstract class NetworkTraining
protected function addIterationToBuffer(float $error, array $synapticWeights) {
$this->iterationEventBuffer->addIteration($this->epoch, $this->datasetReader->getLastReadLineIndex(), $error, $synapticWeights);
}
public function getEpoch(): int
{
return $this->epoch;
}
abstract public function getSynapticWeights(): array;
}