Automatic debiasing of neural networks via moment-constrained learning