Learning Topology-Preserving Data Representations