Sigmoid Function

A sigmoid function (σ) is a mathematical function with an S-shaped curve and a bounded output range (typically between 0 and 1 or -1 and 1).

Sigmoid function

Although the term “sigmoid function” describes a family of functions, it’s often used as an alias for the logistic function defined by the following equation:

σ ( x ) = 1 1 + e x

The derivative of the logistic sigmoid function is:

σ ' ( x ) = σ ( x ) ( 1 - σ ( x ) )

Implementing the sigmoid function in numpy

import numpy as np

def sigmoid(x):
    return 1 / (1 + np.exp(-x))

print(f"σ(0) = {sigmoid(0)}")
σ(0) = 0.5

This page references the following sources:

Here are all the notes in this garden, along with their links, visualized as a graph.