No history yet

Introduction to Neural Networks

The Brain's Blueprint

Neural networks are inspired by the human brain. Our brains are made of billions of cells called neurons, which connect and transmit signals to each other. This vast network is what allows us to think, learn, and recognize patterns.

Artificial neural networks are a much simpler, mathematical version of this biological system. The basic unit is the artificial neuron, sometimes called a node or perceptron. It's designed to mimic a biological neuron in a very basic way.

Lesson image

An artificial neuron receives one or more inputs, processes them, and passes a signal to other neurons. Each input is assigned a weight, which determines its importance. A neuron with a higher weight has more influence on the neuron's output.

The neuron sums up all the weighted inputs. It also adds a special value called a bias, which helps fine-tune the output. Think of it as a knob that shifts the neuron's response up or down. After adding everything up, the neuron applies an activation function to produce its final output.

weight

noun

A parameter within a neural network that transforms input data by scaling it. Weights determine the strength of the connection between neurons.

bias

noun

An extra parameter in a neural network that is added to the weighted sum of inputs. It helps adjust the output along with the weighted inputs.

Building with Neurons

A single neuron isn't very powerful on its own. The magic happens when we connect them together into layers, creating a network. The most common and straightforward architecture is the Multilayer Perceptron (MLP).

An MLP consists of at least three layers of nodes:

  1. Input Layer: This is the network's entry point. It receives the initial data, like the pixels of an image or the words in a sentence. Each node in this layer represents a single feature of the input data.

  2. Hidden Layers: These are the layers between the input and output. A network can have one or many hidden layers, and this is where most of the computation happens. The term "hidden" simply means they aren't directly exposed to the outside world.

  3. Output Layer: This is the final layer. It produces the network's result, such as a classification (e.g., "cat" or "dog") or a numerical prediction.

In an MLP, each neuron in one layer is connected to every neuron in the next layer. This is why it's also called a "fully connected" network. Information flows in one direction, from the input layer through the hidden layers to the output layer.

The Spark of Activation

If neurons only added up weighted inputs, a neural network—no matter how many layers it had—would just be a complex linear function. This would severely limit the kinds of problems it could solve, as most real-world data isn't linear.

This is where activation functions come in. After a neuron calculates its weighted sum, it passes the result through an activation function. This function introduces non-linearity into the network, allowing it to learn much more complex patterns. It's like giving the neuron the ability to make a decision, rather than just passing along a scaled sum.

An activation function decides whether a neuron should be activated or "fired." It squashes the neuron's output into a more manageable range, often between 0 and 1 or -1 and 1.

The entire process for a single neuron can be summarized with a simple formula. First, calculate the weighted sum of inputs (xix_i) and their weights (wiw_i), plus the bias (bb):

z=(w1x1+w2x2+...+wnxn)+b=i=1n(wixi)+bz = (w_1 x_1 + w_2 x_2 + ... + w_n x_n) + b = \sum_{i=1}^{n} (w_i x_i) + b

Then, apply the activation function, often denoted by ff or σ\sigma, to this sum to get the final output, yy:

y=f(z)y = f(z)

This non-linear step, repeated across thousands or millions of neurons, is what gives deep learning models their incredible power.

Quiz Questions 1/5

What is the primary role of an activation function in a neural network?

Quiz Questions 2/5

In a Multilayer Perceptron (MLP), which layer is responsible for producing the final prediction or classification?

Now you have a grasp of the basic building blocks of neural networks. These simple components—neurons, layers, and activation functions—form the foundation for the powerful deep learning models that are transforming technology.