i am implementing a neural network using the Eigen library (for matrix multiplication).
in order to calculate the loss, and to start computing the error derivatives for the output layer, i need to compare the actual outputs in the output layer to the expected values for each output in the output layer.
presumably each node in the output layer has a tag/label associated with it (e.g. if the neural network was for recognising characters then each output neuron would have a tag 'a', 'b' etc) and then the expected values also as a set of tags and a value for each tag. then for each tag you compare the actual output with the expected output (and then calculate the mse etc).
is this the correct approach? if so, i think the expected values would be a map (key = tag, value = expected value) and the actual values to be a single row in an Eigen matrix.
i can manually compare the values but this seems somewhat inefficient. is there a way of comparing the values using Eigen? or does it not matter?