Attention-based Modeling of Physical Systems: Improved Latent Representations