Skip to main content

Neural Networks: Weights, Activation, and Backpropagation

Dive deep into the mathematics behind neural networks step by step, covering weights, biases, activation functions, softmax, and gradient descent.

AI-written
Inewgen
07 Sep 2026Source: Dev.to3 min read (0 views)
Share
Neural Networks: Weights, Activation, and Backpropagation

Stock photo for illustration only, not from the actual event

Font size
  • A perceptron is a shallow neural network with zero hidden layers invented in 1943.
  • Activation functions introduce non-linearity to help networks form complex boundaries.
  • Softmax converts raw logits into probabilities between 0 and 1 summing to 1.0.
  • Backpropagation combined with gradient descent optimizes network weights over time.

If you have ever looked at a neural network diagram and wondered what is actually happening inside, this post breaks down the mathematics behind neural networks step by step. Instead of vague analogies, it explores the exact computational logic powering modern artificial intelligence models.

Before deep learning emerged, neural networks started shallow. A perceptron is a neural network with zero hidden layers, originally invented in 1943. Perceptrons function when data is linearly separable, meaning a straight line can cleanly divide classes. For example, using the equation D = y - 2x - 3, anything where D is greater than or equal to zero falls into Class 1, while anything below zero falls into Class 2.

deep learning neural network node diagram illustration

Stock photo for illustration only, not from the actual event

However, real-world data is rarely that cooperative. When classes intertwine beyond what a straight line can separate, multi-layer networks become essential, marking the true beginning of deep learning. Zooming into a single neuron reveals computations involving inputs (x_i), weights (w_i), a bias (b), and an unbounded logit (S).

Never miss the latest news?

Subscribe to get news summaries by email - not often enough to be annoying.

โฆษณา

Grasping these foundational mathematical principles is essential for AI developers because it demystifies black-box tools. Understanding why raw logits collapse into linear functions without non-linearities allows engineers to troubleshoot training stagnation and hyperparameter tuning with mathematical precision rather than blind trial and error.

Stacking raw logits across layers without extra operations collapses the network into a linear function, rendering depth useless without a twist. That twist is the activation function, such as Sigmoid, which pushes positive values toward 1 and negative values toward 0. This non-linearity allows hidden layers to fold decision boundaries into complex shapes.

Middle layers, known as hidden layers, observe neither inputs nor outputs directly. Early layers capture simple patterns, while deeper layers form abstract connections. Finally, the output layer maps hidden features into predictions, utilizing Softmax for classification tasks to convert unbounded logits into probabilities ranging between 0 and 1.

1943Year the perceptron was invented
128Hidden neurons in the sample code

Once a prediction is made, loss functions like Mean Squared Error or Cross-Entropy measure inaccuracy. Training relies on a continuous loop involving forward propagation, loss calculation, backpropagation, and gradient descent across multiple epochs to iteratively minimize error and update weights.

Source: Dev.to

Comments

Leave a Comment
0/2000

Found something wrong in this article? Report an issue with this article