Weak-lensing shear measurement with machine learning: teaching artificial neural networks about feature noise