Decomposing deep learning models into modules