Back to Course
Neural Networks: From Scratch
Module 1 of 12
1. The Perceptron
1. The Single Neuron
The atom of AI. It takes inputs, weighs them, and makes a decision.
- Weights ($w$): The importance of each input.
- Bias ($b$): The activation threshold.
- Dot Product: $z = w cdot x + b$
pythonclass Perceptron: def __init__(self, num_inputs): self.weights = np.random.randn(num_inputs) self.bias = np.random.randn() def forward(self, x): return np.dot(x, self.weights) + self.bias