Task-Based Learning via Task-Oriented Prediction Network