Implementing engrams from a machine learning perspective: the relevance of a latent space