Dynamic Neural Network Architecture Exploration under Performance and Energy Constraints