AXNet: ApproXimate computing using an end-to-end trainable neural network