Symplectic Neural Networks Based on Dynamical Systems