Training Neural Networks for Execution on Approximate Hardware