Layers
Remember that we are working with tensors, and so we need to relate this data back to those data formats. A single image can be a 28 x 28 matrix, or it can be a 784 value long vector. Our labels are currently integers from 0 to 9. However, as these are really categorical values—not a continuous numerical value from 0 to 9—it is best if we turn the results into a vector. Instead of requiring our model to produce this outright, we should think of the output as a vector of 10 values, with a 1 in the position telling us which digit it thinks it is.
This gives us the parameters that we are working with; we have to input 784 values, and then get 10 values out of our trained network. For this example, we are constructing our layers as per ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access