ODE Discretization Schemes As Optimization Algorithms