Fast convex optimization via closed-loop time scaling of gradient dynamics