MonoLayer Perceptron
This commit is contained in:
26
app/Models/Perceptrons/InputNeuron.php
Normal file
26
app/Models/Perceptrons/InputNeuron.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user