liveBook · Manning

Embedding

As explained in Inside Deep Learning: Math, Algorithms, Models

A one-dimensional array treated as a tensor and used as a model input or feature representation.

A vector is a one-dimensional tensor: an ordered list of values such as [1.9, 2.6, 3.1]. It commonly represents one datapoint or a model input, with each value corresponding to a feature. Its shape is written [d] when it contains d features. section 1.2

Vector input to a linear model

In PyTorch, torch.tensor([1, 2, 3, 4]) creates a vector with shape torch.Size([4]). For a linear model, x contains d features, and nn.Linear(d, C) maps those features to C outputs through a weight matrix and an implicit bias. section 1.2 section 2.1.5

Figure 1.4 Examples of tensors, with more dimensions or axes as we move from left to right. A scalar represents a single value. A vector is a list of values and is how we often think about one datapoint. A matrix is a grid of values and is often used for a dataset. A three-dimensional tensor can be used to represent a dataset of sequences.

Compare a scalar, vector, matrix, and higher-dimensional tensor to see how added axes change the data structure. section 1.2

How Inside Deep Learning: Math, Algorithms, Models covers it

How deep it goes
Defines vectors by dimensionality and shape, then connects feature vectors to matrix-vector multiplication without deriving implementation internals.
Examples
Uses a four-value PyTorch vector, tensor shape output, and a feature vector passed to nn.Linear(d, C).
What you can do after
Apply it via PyTorch by constructing a one-dimensional tensor and matching its feature count to a linear layer's inputs.
How it connects
Connects vectors with tensors, matrices, NumPy, PyTorch, linear regression, matrix-vector products, and bias terms.

Also explained in

Compare how 47 books explain embedding →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Inside Deep Learning: Math, Algorithms, Models. The section links point to the parts of the book it draws on.