Text this: The duality between particle methods and artificial neural networks