Active Inference-Based Optimization of Discriminative Neural Network Classifiers