Open KevenLee opened 5 years ago
Actually, MAE should be abs(sum(a)-sum(b)), in our paper, we use caffe_cpu_asum to compute a abs(sum(abs(a))-sum(abs(b))), and a little different in terms of the equation. However, we use a relu(a) before calculating MAE. Thus, abs(a) is equal to a. Then abs(sum(a)-sum(b)) is equal to abs(sum(abs(a))-sum(abs(b))). I hope it's a good answer to your question. Let me know if you still have questions.
Thanks, I got it
Hi, your code calc. MAE loss in file "mae_layer.cpp"
Dtype asum1 = caffe_cpu_asum(count, bottom[0]->cpu_data()); Dtype asum2 = caffe_cpu_asum(count, bottom[1]->cpu_data()); Dtype loss = abs(asum1-asum2);
does it approximate calculation of mae?
I do not think "sum(abs(a[i]-b[i]))" should be equal to "abs(sum(abs(a)) - sum(abs(b)))"