Gradient-based Hyperparameter Optimization Over Long Horizons