Bookmarks

Neural network

A machine learning model made of layers of simple calculations that adjusts its weights on examples and so learns to find patterns in data.

Also: neural net, artificial neural network, deep neural network

checked 18 Nov

All terms

A neural network turns input numbers into output numbers through a chain of layers. A fully connected layer multiplies the input by a weight matrix and adds a bias, and an activation function sits between layers. The weights are not written by hand; they are fitted from examples.

What it consists of

PartWhat it does
Layerturns its input into a new representation: y = f(Wx + b)
Weights and biasesnumbers that are adjusted during training; their total count is the model’s parameters
Activation functiona non-linearity such as ReLU: without it, any chain of layers would collapse into a single linear transformation
Loss functiona number showing how far the network’s answer is from the correct one

How a network learns

The network computes an answer for an example (the forward pass) and compares it with the correct one using the loss function. Backpropagation then computes the gradient of the loss with respect to each weight, and gradient descent moves the weights in the direction where the loss is lower. This is repeated over many examples, many times. Libraries compute the gradients with automatic differentiation, for example torch.autograd in PyTorch.

Example: a network for 28×28 images

A tutorial network from the PyTorch documentation for the FashionMNIST dataset: an input of 784 pixels, two layers of 512 neurons with ReLU, and an output of 10 classes. It has 784·512 + 512 = 401,920 parameters in the first layer, 512·512 + 512 = 262,656 in the second and 512·10 + 10 = 5,130 in the third, 669,706 in all. Language models work on the same principle, but they have billions of parameters and a different architecture, the transformer.

Deep learning

Deep learning means training networks with many layers. The type of network depends on the data: convolutional networks work with images, while transformers work with text and more.

Sources

the term is written from these pages

Verified 18 Nov

Not to be confused with

what it is mixed up with and how it differs

  • transformer

    A transformer is one neural network architecture, not a synonym for the network itself.

  • model parameters (weights)

    Parameters are the numbers inside the network that change during training; the network is the whole structure together with them.

In depth in the references

where the topic is covered in detail