mirror of
https://github.com/Llewellynvdm/php-ml.git
synced 2024-12-02 09:58:24 +00:00
d85bfed468
* [cs] remove more unused comments * [cs] remove unused array phpdocs * [cs] remove empty lines in docs * [cs] space-proof useless docs * [cs] remove empty @param lines * [cs] remove references arrays
36 lines
695 B
PHP
36 lines
695 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace tests\Phpml\NeuralNetwork\ActivationFunction;
|
|
|
|
use Phpml\NeuralNetwork\ActivationFunction\Gaussian;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class GaussianTest extends TestCase
|
|
{
|
|
/**
|
|
* @dataProvider gaussianProvider
|
|
*/
|
|
public function testGaussianActivationFunction($expected, $value)
|
|
{
|
|
$gaussian = new Gaussian();
|
|
|
|
$this->assertEquals($expected, $gaussian->compute($value), '', 0.001);
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function gaussianProvider()
|
|
{
|
|
return [
|
|
[0.367, 1],
|
|
[1, 0],
|
|
[0.367, -1],
|
|
[0, 3],
|
|
[0, -3],
|
|
];
|
|
}
|
|
}
|