When using neural networks for classification, you usually output as many outputs as there are classes and use a softmax-like layer to get all values between 0 and 1 to then use for CrossEntropy-like loss functions.
Indeed cross entropy expects as many weights as they are classes.
If you want to do regression to a single value, then you might want to use a different loss function.