Structural optimization for efficient deep learning: A unified framework from inference to training | Synapse