Heterogeneity in Neuronal Dynamics is Learned by Gradient Descent for Temporal Processing Tasks