A nonuniform quantizer for hardware implementation of neural networks