Learning Space Metrics