git init
Some checks failed
linter / quality (push) Failing after 6m40s
tests / ci (8.4) (push) Failing after 10s
tests / ci (8.5) (push) Failing after 11s

This commit is contained in:
2026-03-03 11:10:38 +01:00
commit 650cf56045
282 changed files with 27333 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
<?php
namespace App\Events;
use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class PerceptronTrainingEnded implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
/**
* Create a new event instance.
*/
public function __construct(
public string $reason,
public string $sessionId,
)
{
//
}
/**
* Get the channels the event should broadcast on.
*
* @return array<int, \Illuminate\Broadcasting\Channel>
*/
public function broadcastOn(): array
{
return [
new Channel($this->sessionId . '-perceptron-training'),
];
}
public function broadcastWith(): array
{
return [
'reason' => $this->reason,
];
}
}

View File

@@ -0,0 +1,52 @@
<?php
namespace App\Events;
use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
class PerceptronTrainingIteration implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
/**
* Create a new event instance.
*/
public function __construct(
public int $iteration,
public int $exampleIndex,
public float $error,
public array $synaptic_weights,
public string $sessionId,
)
{
//
}
/**
* Get the channels the event should broadcast on.
*
* @return array<int, \Illuminate\Broadcasting\Channel>
*/
public function broadcastOn(): array
{
// Log::debug("Broadcasting on channel: " . $this->sessionId . '-perceptron-training');
return [
new Channel($this->sessionId . '-perceptron-training'),
];
}
public function broadcastWith(): array
{
return [
'iteration' => $this->iteration,
'exampleIndex' => $this->exampleIndex,
'error' => $this->error,
'synaptic_weights' => $this->synaptic_weights,
];
}
}