Prototype Training with Dual Pseudo-Inverse and Optimized Hidden Activations