nngraph pipeline for euclidean distance