public double HandleOutputDerivative(double input, LayerOptions.LayerType layerType) { switch (layerType) { default: return(0.0); case LayerOptions.LayerType.sigmoid: return(Math.MathOperations.SigmoidDerivative(input)); case LayerOptions.LayerType.tanH: return(Math.MathOperations.TanHDerivative(input)); case LayerOptions.LayerType.softMax: return(Math.MathOperations.SoftmaxDerivative(input)); case LayerOptions.LayerType.ReLU: return(Math.MathOperations.ReLUDerivative(input)); case LayerOptions.LayerType.leakyReLU: return(Math.MathOperations.LeakyReLUDerivative(input)); } }
public float HandleOutputSigma(float input, LayerOptions.LayerType layerType) { switch (layerType) { default: return(0.0f); case LayerOptions.LayerType.sigmoid: return(Math.MathOperations.Sigmoid(input)); case LayerOptions.LayerType.tanH: return(Math.MathOperations.TanH(input)); case LayerOptions.LayerType.softMax: return(Math.MathOperations.Softmax(input)); case LayerOptions.LayerType.ReLU: return(Math.MathOperations.ReLU(input)); case LayerOptions.LayerType.leakyReLU: return(Math.MathOperations.LeakyReLU(input)); } }