The Math Behind Neural Networks - Towards Data Science
The Math Behind Neural Networks - Towards Data Science
Member-only story
Image by DALL-E
Neural networks are at the core of artificial intelligence (AI), fueling a variety of
applications from spotting objects in photos to translating languages. In this article,
we’ll dive into what neural networks are, how they work, and why they’re a big deal
in our technology-driven world today.
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 1/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
Index
· 1: Understanding the Basics
∘ 1.1: What are Neural Networks?
∘ 1.2: Types of Neural Networks
· 5: Challenges
∘ 5.1: Overcoming Overfitting
· 6: Conclusion
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 2/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
Image by DALL-E
Our brains have about 86 billion neurons, all linked up in a complex network. These
neurons chat through connections called synapses, where signals can get stronger
or weaker, influencing the message passed along. This is the foundation of how we
learn and remember things.
Artificial neural networks take a page from this book, using digital neurons or
nodes that connect in layers. You’ve got input layers that take in data, hidden layers
that chew on this data, and output layers that spit out the result. As the network gets
fed more data, it adjusts the connection strengths (or “weights”) to learn, kind of
like how our brain’s synapses strengthen or weaken.
Then came deep learning, which is all about neural networks with lots of layers.
These deep neural networks are capable of learning from huge piles of data, and
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 3/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
they’re behind a lot of the AI breakthroughs we hear about, from beating human Go
players to powering self-driving cars.
Thanks to this capability, neural networks are super versatile and can be used for a
wide array of applications, from image recognition to language translation, to
forecasting stock market trends. They’re proving that tasks once thought to require
human intelligence can now be tackled by AI.
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 4/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
For each input, the neuron does a little math: it multiplies the input by a “weight”
and then adds a “bias.” Think of weights as the neuron’s way of deciding how
important an input is, and bias as a tweak to make sure the neuron’s output fits just
right. During the network’s training, it adjusts these weights and biases to get better
at its job.
Next, the neuron sums up all these weighted inputs and biases and runs the total
through a special function called an activation function. This step is where the
magic happens, allowing the neuron to tackle complex patterns by bending and
stretching the data in nonlinear ways. Popular choices for this function are ReLU,
Sigmoid, and Tanh, each with its way of tweaking the data.
2.2: Layers
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 5/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
Neural networks are structured in layers, sort of like a layered cake, with each layer
made up of multiple neurons. The way these layers stack up forms the network’s
architecture:
Input Layer
This is where the data enters the network. Each neuron here corresponds to one
feature of the data. In the image above the input layer is the first layer on the left
holding two nodes.
Hidden Layers
These are the layers sandwiched between the input and output, as we can see from
the image above. You might have just one or a bunch of these hidden layers, doing
the grunt work of computations and transformations. The more layers (and neurons
in each layer) you have, the more intricate patterns the network can learn. But, this
also means more computing power is needed and a higher chance of the network
getting too caught up in the training data, a problem known as overfitting.
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 6/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
Output Layer
This is the network’s final stop, where it spits out the results. Depending on the task,
like if it’s classifying data, this layer might have a neuron for each category, using
something like the softmax function to give probabilities for each category. In the
image above, the last layer holds only one node, suggesting that the is used for a
regression task.
With each layer the data passes through, the network can pick up on more intricate
patterns. Early layers might learn basic stuff like shapes or textures, while deeper
layers get the hang of more complex ideas, like recognizing objects or faces in
pictures.
where:
b is the bias term, a unique parameter that allows adjusting the output along
with the weighted sum.
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 7/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
The weighted sum is crucial because it constitutes the raw input signal to a neuron
before any non-linear transformation. It allows the network to perform a linear
transformation of the inputs, adjusting the importance (weight) of each input in the
neuron’s output.
3.2: Activation Functions
As we said before, activation functions play a pivotal role in determining the output
of a neural network. They are mathematical equations that determine whether a
neuron should be activated or not. Activation functions introduce non-linear
properties to the network, enabling it to learn complex data patterns and perform
tasks beyond mere linear classification, which is essential for deep learning models.
Here, we delve into several key types of activation functions and their significance:
This function squeezes its input into a narrow range between 0 and 1. It’s like taking
any value, no matter how large or small, and translating it into a probability.
You’ll see sigmoid functions in the final layer of binary classification networks,
where you need to decide between two options — yes or no, true or false, 1 or 0.
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 8/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
Open in app
Search
tanh stretches the output range to between -1 and 1. This centers the data around 0,
making it easier for layers down the line to learn from it.
It’s often found in the hidden layers, helping to model more complex data
relationships by balancing the input signal.
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 9/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
ReLU is like a gatekeeper that passes positive values unchanged but blocks
negatives, turning them to zero. This simplicity makes it very efficient and helps
overcome some tricky problems in training deep neural networks.
Its simplicity and efficiency have made ReLU incredibly popular, especially in
convolutional neural networks (CNNs) and deep learning models.
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 10/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
Leaky ReLU allows a tiny, non-zero gradient when the input is less than zero, which
keeps neurons alive and kicking even when they’re not actively firing.
It’s a tweak to ReLU used in cases where the network might suffer from “dead
neurons,” ensuring all parts of the network stay active over time.
ELU smooths out the function for negative inputs (using a parameter α for scaling),
allowing for negative outputs but with a gentle curve. This can help the network
maintain a mean activation closer to zero, improving learning dynamics.
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 11/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
Useful in deeper networks where ReLU’s sharp threshold could slow down learning.
Softmax Function
The softmax function turns logits, the raw output scores from the neurons, into
probabilities by exponentiating and normalizing them. It ensures that the output
values sum up to one, making them directly interpretable as probabilities.
It’s the go-to for the output layer in multi-class classification problems, where each
neuron corresponds to a different class, and you want to pick the most likely one.
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 12/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
where:
Mathematically, the weight update rule in gradient descent can be expressed as:
where:
w-newand w-oldrepresent the updated (new) and current (old) values of the
weight, respectively,
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 13/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
η is the learning rate, a hyperparameter that controls the size of the step taken
in the direction of the negative gradient,
Network Structure:
Forward Pass
Given inputs x1, x2, weights w, and biases b, the forward pass calculates the
network’s output. The process for a single hidden layer network with ReLU
activation in the hidden layer and a sigmoid activation in the output layer is as
follows:
Given an input vector [x1, x2], the weighted sum for each neuron in the hidden layer
is:
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 14/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
Let the weights from the hidden layer to the output neuron be w31, w32, and the
bias be b3.
The gradients of the loss for weights and bias of the output layer:
The gradients of the loss concerning weights and biases of the hidden layer:
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 16/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
These steps are then repeated until a criterion is met, such as a maximum number
of epochs.
3.5: Improvements
While the basic idea of Gradient Descent is simple — take small steps in the
direction that reduces error the most — several tweaks and improvements have
been made to this method to enhance its efficiency and effectiveness.
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 17/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
You can find the whole code on this Jupyter Notebook. The notebook contains a
fine-tuning bonus that will likely increase the performance of the Neural Network:
models-from-scratch-python/Neural Network/demo.ipynb at
main ·…
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 18/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
NeuralNetwork Class
Let’s start with the NN class, which defines the architecture of our Neural Network:
import numpy as np
class NeuralNetwork:
"""
A simple neural network with one hidden layer.
Parameters:
-----------
input_size: int
The number of input features
hidden_size: int
The number of neurons in the hidden layer
output_size: int
The number of neurons in the output layer
loss_func: str
The loss function to use. Options are 'mse' for mean squared error, 'lo
"""
def __init__(self, input_size, hidden_size, output_size, loss_func='mse'):
self.input_size = input_size
self.hidden_size = hidden_size
self.output_size = output_size
self.loss_func = loss_func
# track loss
self.train_loss = []
self.test_loss = []
Parameters:
-----------
X: numpy array
The input data
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 19/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
Returns:
--------
numpy array
The predicted output
"""
# Perform forward propagation
self.z1 = np.dot(X, self.weights1) + self.bias1
self.a1 = self.sigmoid(self.z1)
self.z2 = np.dot(self.a1, self.weights2) + self.bias2
if self.loss_func == 'categorical_crossentropy':
self.a2 = self.softmax(self.z2)
else:
self.a2 = self.sigmoid(self.z2)
return self.a2
Parameters:
-----------
X: numpy array
The input data
y: numpy array
The target output
learning_rate: float
The learning rate
"""
# Perform backpropagation
m = X.shape[0]
# Calculate gradients
if self.loss_func == 'mse':
self.dz2 = self.a2 - y
elif self.loss_func == 'log_loss':
self.dz2 = -(y/self.a2 - (1-y)/(1-self.a2))
elif self.loss_func == 'categorical_crossentropy':
self.dz2 = self.a2 - y
else:
raise ValueError('Invalid loss function')
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 20/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
Parameters:
-----------
x: numpy array
The input data
Returns:
--------
numpy array
The output of the sigmoid function
"""
return 1 / (1 + np.exp(-x))
Parameters:
-----------
x: numpy array
The input data
Returns:
--------
numpy array
The output of the derivative of the sigmoid function
"""
return x * (1 - x)
Parameters:
-----------
x: numpy array
The input data
Returns:
--------
numpy array
The output of the softmax function
"""
exps = np.exp(x - np.max(x, axis=1, keepdims=True))
return exps/np.sum(exps, axis=1, keepdims=True)
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 21/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
Initialization
# track loss
self.train_loss = []
self.test_loss = []
The __init__ method initializes a new instance of the NeuralNetwork class. It takes
the size of the input layer ( input_size ), the hidden layer ( hidden_size ), and the
output layer ( output_size ) as arguments, along with the type of loss function to use
( loss_func ), which defaults to mean squared error ('mse').
Inside this method, the network’s weights and biases are initialized. weights1
connects the input layer to the hidden layer, and weights2 connects the hidden layer
to the output layer. The biases ( bias1 and bias2 ) are initialized to zero arrays. This
initialization uses random numbers for weights to break symmetry and zeros for
biases as a starting point.
It also initializes two lists, train_loss and test_loss , to track the loss during the
training and testing phases, respectively.
else:
self.a2 = self.sigmoid(self.z2)
return self.a2
The forward method takes the input data X and passes it through the network. It
calculates the weighted sums ( z1 , z2 ) and applies the activation function (sigmoid
or softmax, depending on the loss function) to these sums to get the activations ( a1 ,
a2 ).
For the hidden layer, it always uses the sigmoid activation function. For the output
layer, it uses softmax if the loss function is ‘categorical_crossentropy’ and sigmoid
otherwise. The choice between sigmoid and softmax depends on the nature of the
task (binary/multi-class classification).
This method returns the final output ( a2 ) of the network, which can be used to
make predictions.
# Calculate gradients
if self.loss_func == 'mse':
self.dz2 = self.a2 - y
elif self.loss_func == 'log_loss':
self.dz2 = -(y/self.a2 - (1-y)/(1-self.a2))
elif self.loss_func == 'categorical_crossentropy':
self.dz2 = self.a2 - y
else:
raise ValueError('Invalid loss function')
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 23/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
It calculates the gradients of the loss function for the weights and biases ( dw2 , db2 ,
dw1 , db1 ) using the chain rule. The gradients indicate how much the weights and
biases need to be adjusted to minimize the error.
The learning rate ( learning_rate ) controls how big of a step is taken during the
update. The method then updates the weights and biases by subtracting the product
of the learning rate and their respective gradients.
Different gradient calculations are performed based on the chosen loss function,
illustrating the flexibility of the network to adapt to various tasks.
sigmoid : This method implements the sigmoid activation function, which squashes
the input values into a range between 0 and 1. It's particularly useful for binary
classification problems.
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 24/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
Trainer Class
The code below introduces a Trainer class designed to train a neural network
model. It encapsulates everything needed to conduct training, including executing
training cycles (epochs), calculating loss, and adjusting the model's parameters
through backpropagation based on the loss.
class Trainer:
"""
A class to train a neural network.
Parameters:
-----------
model: NeuralNetwork
The neural network model to train
loss_func: str
The loss function to use. Options are 'mse' for mean squared error, 'lo
"""
def __init__(self, model, loss_func='mse'):
self.model = model
self.loss_func = loss_func
self.train_loss = []
self.test_loss = []
Parameters:
-----------
y_true: numpy array
The true output
y_pred: numpy array
The predicted output
Returns:
--------
float
The loss
"""
if self.loss_func == 'mse':
return np.mean((y_pred - y_true)**2)
elif self.loss_func == 'log_loss':
return -np.mean(y_true*np.log(y_pred) + (1-y_true)*np.log(1-y_pred)
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 25/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
Parameters:
-----------
X_train: numpy array
The training input data
y_train: numpy array
The training target output
X_test: numpy array
The test input data
y_test: numpy array
The test target output
epochs: int
The number of epochs to train the model
learning_rate: float
The learning rate
"""
for _ in range(epochs):
self.model.forward(X_train)
self.model.backward(X_train, y_train, learning_rate)
train_loss = self.calculate_loss(y_train, self.model.a2)
self.train_loss.append(train_loss)
self.model.forward(X_test)
test_loss = self.calculate_loss(y_test, self.model.a2)
self.test_loss.append(test_loss)
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 26/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
The constructor takes a neural network model ( model ) and a loss function
( loss_func ) as inputs. The loss_func defaults to mean squared error ('mse') if not
specified.
It initializes train_loss and test_loss lists to keep track of the loss values during
the training and testing phases, allowing for monitoring of the model's performance
over time.
This method calculates the loss between the predicted outputs ( y_pred ) and the true
outputs ( y_true ) using the specified loss function. This is crucial for evaluating how
well the model is performing and for performing backpropagation.
Mean Squared Error (‘mse’): Used for regression tasks, calculating the average of
the squares of the differences between predicted and true values.
Logistic Loss (‘log_loss’): Suited for binary classification problems, computing the
loss using the log-likelihood method.
self.model.forward(X_test)
test_loss = self.calculate_loss(y_test, self.model.a2)
self.test_loss.append(test_loss)
The train method manages the training process over a specified number of epochs
using the training ( X_train , y_train ) and testing datasets ( X_test , y_test ). It also
takes a learning_rate parameter that influences the step size in the parameter
update during backpropagation.
For each epoch (training cycle), the method performs the following steps:
1. Forward Pass on Training Data: It uses the model’s forward method to compute
the predicted outputs for the training data.
2. Backward Pass (Parameter Update): It applies the model’s backward method using
the training data and labels ( y_train ) along with the learning_rate to update the
model's weights and biases based on the gradients calculated from the loss.
3. Calculate Training Loss: The training loss is calculated using the calculate_loss
method with the training labels and the predictions. This loss is then appended
to the train_loss list for monitoring.
4. Forward Pass on Testing Data: Similarly, the method computes predictions for the
testing data to evaluate the model’s performance on unseen data.
5. Calculate Testing Loss: It calculates the testing loss using the testing labels and
predictions, appending this loss to the test_loss list.
Implementation
In this section, I will outline a complete process for loading a dataset, preparing it
for training, and using it to train a neural network for a classification task. The
process involves data preprocessing, model creation, training, and evaluation.
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 28/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
For this task, we will use the digits dataset from the open-source (BSD-3 license)
sci-kit learn library. Click here for more information about Sci-Kit Learn.
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 29/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
The dataset used here is the digits dataset, which is commonly used for
classification tasks involving recognizing handwritten digits.
The features of the dataset are scaled to a range between 0 and 1 using the
MinMaxScaler . This is a common preprocessing step to ensure that all input features
have the same scale, which can help the neural network learn more effectively.
The scaled features are stored in X, and the target labels (which digit each image
represents) are stored in y.
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 30/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
Since this is a classification task with multiple classes, the target labels are one-hot
encoded using OneHotEncoder . One-hot encoding transforms the categorical target
data into a format that's easier for neural networks to understand and work with,
especially for classification tasks.
The dataset is split into training and testing sets using train_test_split , with 80% of
the data used for training and 20% for testing. This split allows for training the
model on one portion of the data and then evaluating its performance on a separate,
unseen portion to check how well it generalizes.
A neural network instance is created with specified input size (the number of
features), hidden size (the number of neurons in the hidden layer), output size (the
number of unique labels), and the loss function to use. The input size matches the
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 31/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
number of features, the output size matches the number of unique target classes,
and a hidden layer size is chosen.
An instance of the Trainer class is created with the neural network and loss
function. The train method is then called with the training and testing datasets,
along with the number of epochs and the learning rate specified. This process
iteratively adjusts the neural network's weights and biases to minimize the loss
function, using the training data for learning and the testing data for validation.
After training, the model’s performance is evaluated on the test set. Since the targets
were one-hot encoded, np.argmax is used to convert the one-hot encoded
predictions back to label form. The accuracy of the model is calculated by
comparing these predicted labels against the actual labels ( y_test_labels ) and then
printed out.
Now, this code lacks a few activation functions we talked about, improvements such
as SGD or Adam Optimizer, and more. I leave this to you to take and make this code
your own, by filling the gaps with your code. In this way, you will truly master
Neural Networks.
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 32/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
Well, that was a lot! Luckily for us, we don’t need to write such a long code every
time we want to work with NNs. We can leverage libraries such as Tensorflow and
PyTorch which will create Deep Learning models for us with minimum code. In this
example, we will create and explain a TensorFlow version of training a neural
network on the digits dataset, similar to the process described previously.
As before let’s first import the required libraries, and the dataset and let’s
preprocess it, in the same fashion we did before.
import tensorflow as tf
from sklearn.datasets import load_digits
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler, OneHotEncoder
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 33/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
The first layer is a densely-connected layer with 64 units (neurons) and ReLU
activation. It expects input from the shape (X_train.shape[1],) , which matches the
number of features in the dataset.
The output layer has several units equal to the number of unique target classes and
uses the softmax activation function to output probabilities for each class.
The model is compiled with the Adam optimizer and categorical cross-entropy as
the loss function, suitable for multi-class classification tasks. Accuracy is specified
as a metric for evaluation.
The model is trained using the fit method with 1000 epochs, and the testing set is
used as validation data. verbose=2 indicates that one line per epoch will be printed
for logging.
Finally, the model’s performance is evaluated on the test set using the evaluate
5: Challenges
5.1: Overcoming Overfitting
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 34/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
Overfitting is like when a neural network becomes a bit too obsessed with its
training data, picking up on all the tiny details and noise, to the point where it
struggles to handle new, unseen data. It’s like studying so hard for your exams by
memorizing the textbook word for word but then not being able to apply what
you’ve learned to any question that’s phrased differently. This problem can hold
back a model’s ability to perform well in real-world situations, where being able to
generalize or apply what it’s learned to new scenarios, is key. Luckily, there are
several clever techniques to help prevent or lessen overfitting, making our models
more versatile and ready for the real world. Let’s take a look at a few of them, but
don’t worry about mastering all of them now as I will cover anti-overfitting
techniques in a separate article.
Dropout: This is like randomly turning off some of the neurons in the network
during training. It stops the neurons from getting too dependent on each other,
forcing the network to learn more robust features that aren’t just relying on a
specific set of neurons to make predictions.
Early Stopping
This involves watching how the model does on a validation set (a separate chunk of
data) as it’s training. If the model starts doing worse on this set, it’s a sign that it’s
beginning to overfit, and it’s time to stop training.
As you experiment with NN, you will see that fine-tuning and tackling overfitting
will play a pivotal role in NN’s performance. Making sure you master anti-overfitting
techniques is a must for a successful data scientist. Because of its importance, I will
dedicate an entire article to these techniques to make sure you can fine-tune the
best NNs and guarantee an optimal performance for your projects.
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 35/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
6: Conclusion
Diving into the world of neural networks opens our eyes to the incredible potential
these models hold within the realm of artificial intelligence. Starting with the
basics, like how neural networks use weighted sums and activation functions to
process information, we’ve seen how techniques like backpropagation and gradient
descent empower them to learn from data. Especially in areas like image
recognition, we’ve witnessed firsthand how neural networks are solving complex
challenges and pushing technology forward.
Looking ahead, it’s clear we are only at the beginning of a long journey called “Deep
Learning”. In the next articles, we will talk about more advanced deep learning
architectures, fine-tuning methods, and much more!
Bibliography
1. Goodfellow, Ian, Yoshua Bengio, and Aaron Courville. “Deep Learning.” MIT
Press, 2016. This comprehensive textbook provides an extensive overview of
deep learning, covering the mathematical underpinnings and practical aspects
of neural networks.
2. LeCun, Yann, Yoshua Bengio, and Geoffrey Hinton. “Deep learning.” Nature 521,
no. 7553 (2015): 436–444. A landmark paper by pioneers in the field,
summarizing the key concepts and achievements in deep learning and neural
networks.
You made it to the end. Congrats! I hope you enjoyed this article, if so consider
leaving a like and following me, as I will regularly post similar articles. My goal is to
recreate all the most popular algorithms from scratch and make machine learning
accessible to everyone.
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 36/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
Follow
A Data Scientist with a passion about recreating all the popular machine learning algorithm from scratch.
Cristian Leo
Sep 10 240
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 37/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
Sep 6 1.2K 13
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 38/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
Sep 20 2K 21
Cristian Leo
Sep 4 155 3
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 39/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
Sep 15 2.8K 83
Prasad Mahamulkar
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 40/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
Aug 29 1.1K 10
Lists
Alexander Nguyen
I Wrote On LinkedIn for 100 Days. Now I Never Worry About Finding a Job.
Everyone is hiring.
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 41/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
4d ago 392 3
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 42/43
30/09/2024, 14:34 The Math Behind Neural Networks | Towards Data Science
4d ago 421 3
Emmanuel Ikogho
Sep 3 1.1K 48
https://towardsdatascience.com/the-math-behind-neural-networks-a34a51b93873 43/43