Distributed Deep Learning in IoT: Splitting Neural Networks in Inference and Training