A vector is an ordered sequence of numerical entries representing a mathematical quantity or data point. Each position stores one feature, such as a word count or pixel value. section 5.9
Turning an image into a vector
A 28-by-28 grayscale image becomes a vector with 784 entries by joining its rows. A digit label becomes a length-10 vector with one nonzero entry marking the digit. section 10.19
Figure 10.24 Before training the neural network, we preprocess the images and the labels in the following way. We shape the rectangular image into a long vector by concatenating the rows. We then convert each label into a vector of length 10 with only one non-zero entry in the position of the corresponding label.
Follow the visual transformation from a rectangular handwritten digit to a long input vector and from a label to a one-entry output vector. section 10.19
Representing a sentence
A sentence with three words appearing 5, 8, and 3 times becomes the vector (5, 8, 3). A perceptron combines these entries with word weights and a bias. section 5.9













