Improving scalability and inference in probabilistic deep models