Flexible Neural Representation for Physics Prediction