Files
Ninluc 08aa04fe56
linter / quality (push) Successful in 7m10s
tests / ci (8.4) (push) Successful in 4m43s
tests / ci (8.5) (push) Successful in 4m47s
Multilayer neuron network
2026-09-08 16:29:02 +02:00

14 lines
273 B
PHP

<?php
namespace App\Models\Perceptrons;
class SigmoidPerceptron extends Perceptron
{
public function activationFunction(float $weighted_sum): float
{
$weighted_sum = max(-40, min(40, $weighted_sum));
return 1 / (1 + exp(-$weighted_sum));
}
}