Implement euclidean loss layer.