List of activation functions in C#

后端 未结 1 2049
醉梦人生
醉梦人生 2021-02-04 15:16

I can find a list of activation functions in math but not in code. So i guess this would be the right place for such a list in code if there ever should be one. starting with th

相关标签:
1条回答
  • 2021-02-04 15:50

    I found this: Soft Exponential activation function

    C# Convert:

    public double SoftExponential(double x, double alpha = 0.0, double max_value = 0.0)
    {
    
        // """Soft Exponential activation function by Godfrey and Gashler
        // See: https://arxiv.org/pdf/1602.01321.pdf
        // α == 0:  f(α, x) = x
        // α  > 0:  f(α, x) = (exp(αx)-1) / α + α
        // α< 0:  f(α, x) = -ln(1 - α(x + α)) / α
        // """
    
        if (alpha == 0)
            return x;
        else if (alpha > 0)
            return alpha + (Math.Exp(alpha * x) - 1.0) / alpha;
        else
            return -Math.Log(1 - alpha * (x + alpha)) / alpha;
    }
    
    0 讨论(0)
提交回复
热议问题