Deep Neural Network: Output a Magnitude, not merely a Category How does (can?) a deep neural network provide a magnitude estimate, rather than simply guessing what category an input belongs to?

For example, in guessing the weight of a cat, is there is a different way than creating discrete categories of cats (1 kg, 1.01 kg ... 10 kg), having the network guess the category from an image of the particular cat, and then deduce the weight given the category it chose?
You simply need to make your last layer have 1 neuron and no activation function, so that the output of the network is a single number.

Other than that make sure that you select a loss function for regression (e.g. mean absolute error, mean squared error, etc.)