Files
perceptron-viewer/app/Models/Perceptrons/InputNeuron.php
T
Ninluc 69e683bcaf
linter / quality (push) Successful in 4m24s
tests / ci (8.4) (push) Successful in 4m47s
tests / ci (8.5) (push) Successful in 5m0s
Some bugfixes and misc
2026-09-08 20:01:52 +02:00

29 lines
515 B
PHP

<?php
namespace App\Models\Perceptrons;
class InputNeuron extends Perceptron
{
private float $input = 0.0;
public function __construct(
) {
parent::__construct([]);
}
public function setInput(float $input): void
{
$this->input = $input;
}
public function test(array $inputs): array
{
return [$this->input];
}
public function activationFunction(float $input): float
{
return $input; // Identity function for input neurons
}
}