Self-calibrating neural networks for dimensionality reduction