A fast, universal algorithm to learn parametric nonlinear embeddings