Compressing and regularizing deep neural networks