Table of Contents

Class BipolarSigmoid

Namespace
NeuralNetworks.Operations.ActivationFunctions
Assembly
NeuralNetworks.dll

Represents a bipolar sigmoid activation operation that applies a scaled sigmoid function shifted to the range [-0.5, 0.5].

public class BipolarSigmoid : ActivationFunction2D
Inheritance
BipolarSigmoid
Inherited Members

Remarks

The bipolar sigmoid function is commonly used in neural networks to introduce non-linearity while centering the output around zero. This operation computes output as scale × (σ(x) – 0.5), where σ(x) is the standard sigmoid function. Setting an appropriate scale can affect the gradient flow and the range of activations.

With scale = 2: y = 2σ(x) − 1, which is exactly the bipolar (a.k.a. symmetric/zero-centered) sigmoid. It’s mathematically identical to tanh(x/2). For general scale s: y = (s/2) · tanh(x/2), i.e., a scaled tanh.Range is [−s/2, s/2].

Constructors

BipolarSigmoid(float)

Represents a bipolar sigmoid activation operation that applies a scaled sigmoid function shifted to the range [-0.5, 0.5].

public BipolarSigmoid(float scale)

Parameters

scale float

The scaling factor applied to the output of the sigmoid function. Must be non-zero.

Remarks

The bipolar sigmoid function is commonly used in neural networks to introduce non-linearity while centering the output around zero. This operation computes output as scale × (σ(x) – 0.5), where σ(x) is the standard sigmoid function. Setting an appropriate scale can affect the gradient flow and the range of activations.

With scale = 2: y = 2σ(x) − 1, which is exactly the bipolar (a.k.a. symmetric/zero-centered) sigmoid. It’s mathematically identical to tanh(x/2). For general scale s: y = (s/2) · tanh(x/2), i.e., a scaled tanh.Range is [−s/2, s/2].

Methods

CalcInputGradient(float[,])

Calculates input gradient.

protected override float[,] CalcInputGradient(float[,] outputGradient)

Parameters

outputGradient float[,]

Returns

float[,]

Remarks

Based on outputGradient, calculates changes in input.

CalcOutput(bool)

Computes output.

protected override float[,] CalcOutput(bool inference)

Parameters

inference bool

Returns

float[,]

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.