Learning Dynamic Spatial Relations