Files
Reseaux-de-neurones-artific…/app/Models/Perceptrons/SimpleBinaryPerceptron.php

19 lines
353 B
PHP

<?php
namespace App\Models\Perceptrons;
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;
}
}