Multilayer neuron network
This commit is contained in:
@@ -38,8 +38,17 @@ class PerceptronTrainingIteration implements ShouldBroadcast
|
||||
|
||||
public function broadcastWith(): array
|
||||
{
|
||||
$lastIterationIndex = count($this->iterations) - 1;
|
||||
$iterations = array_map(
|
||||
fn (array $iteration, int $index): array => $index === $lastIterationIndex
|
||||
? $iteration
|
||||
: [...$iteration, 'weights' => []],
|
||||
$this->iterations,
|
||||
array_keys($this->iterations),
|
||||
);
|
||||
|
||||
return [
|
||||
'iterations' => $this->iterations,
|
||||
'iterations' => $iterations,
|
||||
'trainingId' => $this->trainingId,
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user