19 lines
327 B
PHP
19 lines
327 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
class SimplePerceptron extends Perceptron {
|
|
|
|
public function __construct(
|
|
array $synaptic_weights,
|
|
) {
|
|
parent::__construct($synaptic_weights);
|
|
}
|
|
|
|
public function activationFunction(float $weighted_sum): int
|
|
{
|
|
return $weighted_sum >= 0 ? 1 : 0;
|
|
}
|
|
|
|
}
|