  Forecasting the evolution of contagion dynamics is still an open problem to
which mechanistic models only offer a partial answer. To remain mathematically
or computationally tractable, these models must rely on simplifying
assumptions, thereby limiting the quantitative accuracy of their predictions
and the complexity of the dynamics they can model. Here, we propose a
complementary approach based on deep learning where the effective local
mechanisms governing a dynamic on a network are learned from time series data.
Our graph neural network architecture makes very few assumptions about the
dynamics, and we demonstrate its accuracy using different contagion dynamics of
increasing complexity. By allowing simulations on arbitrary network structures,
our approach makes it possible to explore the properties of the learned
dynamics beyond the training data. Finally, we illustrate the applicability of
our approach using real data of the COVID-19 outbreak in Spain. Our results
demonstrate how deep learning offers a new and complementary perspective to
build effective models of contagion dynamics on networks.
