Learning Generalized Hamiltonians using fully Symplectic Mappings