From Hard to Soft: Understanding Deep Network Nonlinearities via Vector Quantization and Statistical Inference