Physics-Informed Machine Learning of Dynamical Systems for Efficient Bayesian Inference