Added function to evaluate mapping gradient