git init
This commit is contained in:
18
app/Models/SimplePerceptron.php
Normal file
18
app/Models/SimplePerceptron.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class SimplePerceptron extends Perceptron {
|
||||
|
||||
public function __construct(
|
||||
array $synaptic_weights,
|
||||
) {
|
||||
parent::__construct($synaptic_weights);
|
||||
}
|
||||
|
||||
protected function activationFunction(float $weighted_sum): int
|
||||
{
|
||||
return $weighted_sum >= 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user