Learning Prototype Models for Tangent Distance