Learning to understand environmental dynamics