A very simple question, I am reading the documentation on Euclidean Loss
http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1EuclideanLossLayer.html#details and wanted to understand something. Supposing that the output of your CNN is a 2x2 image and your loss function is Euclidean (a regression task), how exactly is the loss computed? For example, if my testing net has a batch size of 2 with sample output as below:
Network Output = array([[[2, 3],
[4, 5]],
[[6, 7],
[8, 9]]])
Target = array([[[2, 4],
[5, 3]],
[[6, 8],
[9, 9]]])
Will the loss be = (1/(2*2)) * [((2-2)**2 + (3-4)**2 + (4-5)**2 + (5-3)**2) + ((6-6)**2 + (7-8)**2 + (8-9)**2 + (9-9)**2)]
= (1/4) * [(0 + 1 + 1 + 4) + (0 + 1 + 1 + 0)]
= (1/4)* [6 + 2]
= 2?