Deep learning for track recognition in pixel and strip-based particle detectors