Chapter 2. Before we begin: the mathematical building blocks of neural networks Flashcards
(29 cards)
What is a class ?
It’s a category in a classification problem
What is a sample ?
samples are data points
What is a label ?
The class associated with a specific sample
What is a loss function ?
How the network will be able to measure its performance on the training data, and thus how it will be able to steer itself in the right direction.
What is an optimizer ?
The mechanism through which the network will update itself based on the data it sees and its loss function.
What are the metrics to monitor during the training and testing process ?
Here, we’ll only care about accuracy (the fraction of the images that were correctly classified).
What is a tensor ?
Data stored in multidimensional Numpy arrays.
At its core, a tensor is a container for data—almost always numerical data. So, it’s a container for numbers. You may be already familiar with matrices, which are 2D tensors: tensors are a generalization of matrices to an arbitrary number of dimensions (note that in the context of tensors, a dimension is often called an axis).
What is a scalar ?
A tensor that contains only one number
How many number of axis a scalar tensor has ?
0
Which attribute do you use to display number of axis of a tensor ?
.ndim
What is called an array of numbers ?
An array of numbers is called a vector, or 1D tensor. A 1D tensor is said to have exactly one axis.
What is a tensor rank ?
the number of axes
What is a matrix ?
An array of vectors or 2D tensors
A tensor is defined by which three attributes ?
- Number of Axes
- Shape
- Data Type
What is a tensor shape ?
It is a tuple of integers that describes how many dimensions the tensor has along each axis. For instance, the previous matrix example has shape (3, 5), and the 3D tensor example has shape (3, 3, 5). A vector has a shape with a single element, such as (5,), whereas a scalar has an empty shape, ().
What is tensor slicing ?
Selecting a specific item in a tensor
What is a batch axis or batch dimension ?
It’s the first axis ( axis 0 )
What to steps broadcasting consist of:
- Axes (called broadcast axes) are added to the smaller tensor to match the ndim of the larger tensor.
- The smaller tensor is repeated alongside these new axes to match the full shape of the larger tensor.
What is tensor reshaping ?
Reshaping a tensor means rearranging its rows and columns to match a target shape
What is Transposing a Matrix ?
It means exchanging its rows and its columns so that x[i, :] becomes x[:, i]:
Summarise steps for a training loop:
- Draw a batch of training samples x and corresponding targets y.
- Run the network on x (a step called the forward pass) to obtain predictions y_pred.
- Compute the loss of the network on the batch, a measure of the mismatch between y_pred and y.
- Update all weights of the network in a way that slightly reduces the loss on this batch.
What is a function’s minimum ?
it is a point where the derivate is 0
Applied to a neural network, that means finding analytically the combination of weight values that yields the smallest possible loss function
What is stochastic ?
Stochastic is a scientific synonym of random
Where the knowledge of the network persists ?
In the weights tensors