The combination of machine learning models with physical models is a recent research path to learn robust data representations. In this talk, I introduce p3VAE, a variational autoencoder that integrates prior physical knowledge of how data acquisition conditions relate to data. p3VAE combines standard neural network layers with non-trainable physics layers in order to partially ground the latent space to physical variables. p3VAE is optimized through a semi-supervised learning algorithm that strikes a balance between the machine learning part and the physics part. Experiments on simulated and real data sets, comprising pendulum time series and hyperspectral images, demonstrate the benefits of our framework against competing physics-informed and conventional machine learning models, in terms of extrapolation capabilities and interpretability. In particular, I will discuss the disentanglement capabilities of p3VAE.