Deep learning for image and speech recognition