Variational latent discrete representation for time series modelling