mirror of
https://github.com/Llewellynvdm/php-ml.git
synced 2024-06-07 02:50:48 +00:00
21 lines
348 B
PHP
21 lines
348 B
PHP
<?php
|
|
|
|
declare (strict_types = 1);
|
|
|
|
namespace Phpml\NeuralNetwork\ActivationFunction;
|
|
|
|
use Phpml\NeuralNetwork\ActivationFunction;
|
|
|
|
class Gaussian implements ActivationFunction
|
|
{
|
|
/**
|
|
* @param float|int $value
|
|
*
|
|
* @return float
|
|
*/
|
|
public function compute($value): float
|
|
{
|
|
return exp(-pow($value, 2));
|
|
}
|
|
}
|