ALERT: Accurate Anytime Learning for Energy and Timeliness