Rematerializing Graphs: Learning Spatial Configuration