Path-minimizing Latent ODEs for improved extrapolation and inference