19 lines
341 B
PHP
19 lines
341 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
class SimpleBinaryPerceptron extends Perceptron {
|
|
|
|
public function __construct(
|
|
array $synaptic_weights,
|
|
) {
|
|
parent::__construct($synaptic_weights);
|
|
}
|
|
|
|
public function activationFunction(float $weighted_sum): float
|
|
{
|
|
return $weighted_sum >= 0.0 ? 1.0 : 0.0;
|
|
}
|
|
|
|
}
|