logisticSigmoid

Logistic sigmoid function, useful for neural networks. Returns 1 / (1 + e^(-t))

@safe @nogc nothrow pure
T
logisticSigmoid
(
T
)
(
T t
)
if (
__traits(isArithmetic, T)
)

Examples

assert(logisticSigmoid(1000.0) == 1.0);
assert(logisticSigmoid(-1000.0) == 0.0);
assert(logisticSigmoid(1000) == 1);
assert(logisticSigmoid(-1000) == 0);

Meta