sigmoid function

double sigmoid(
  1. double x
)

Shrinks the range of values to inbetween 0 and 1 using exponentials. Results can be driven into saturation, which makes the sigmoid function unsuited for deep networks with random initialisation.

Implementation

double sigmoid(double x) => 1 / (1 + exp(-x));