Combinatorial optimization for low bit-width neural networks