Skip to content
    Neuron City

    DEEP LEARNING · 9 MIN

    The Neuron (Perceptron)

    A neuron computes a weighted sum of inputs plus bias, then applies an activation function.

    PIXEL explains

    • z = w₁x₁ + w₂x₂ + … + b.
    • Activation adds non-linearity: step, sigmoid, ReLU = max(0, z).
    • Stacking layers of neurons forms a neural network.

    Real world: Deciding to go out: weather, money and friends are inputs, each with its own importance.

    Watch it move

    Σ

    Inputs x = [1, 2]

    1/4

    Code

    def neuron(x, w, b):
        z = sum(xi*wi for xi, wi in zip(x, w)) + b
        return max(0, z)  # ReLU
    print(neuron([1, 2], [0.5, -0.25], 0.1))
    Output ›
    0.1
    Try it in the online compiler →

    Checkpoint quiz

    ReLU(−3) = ?