Generalized Gradient Flows For Density Prediction, Control And Learning