27 lines
482 B
PHP
27 lines
482 B
PHP
<?php
|
|
|
|
namespace App\Models\Perceptrons;
|
|
|
|
class InputNeuron extends Perceptron
|
|
{
|
|
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
|
|
}
|
|
}
|