Skip to content
Permalink
1868c2be46
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
29 lines (26 sloc) 627 Bytes
<?php
namespace Rubix\Engine\NeuralNetwork\ActivationFunctions;
class Gaussian implements ActivationFunction
{
/**
* Compute the output value.
*
* @param float $value
* @return float
*/
public function compute(float $value) : float
{
return exp(-($value ** 2));
}
/**
* Calculate the partial derivative with respect to the computed output.
*
* @param float $value
* @param float $computed
* @return float
*/
public function differentiate(float $value, float $computed) : float
{
return -2 * $value * $computed;
}
}