Learning the dynamics of metamaterials from diffracted waves with convolutional neural networks