Machine learning of continuous and discrete variational ODEs with convergence guarantee and uncertainty quantification | Synapse