  We present an algorithm for inferring the dynamical mass of galaxy clusters
directly from their respective phase-space distributions, i.e. the observed
line-of-sight velocities and projected distances of galaxies from the cluster
centre. Our method employs normalizing flows, a deep neural network capable of
learning arbitrary high-dimensional probability distributions, and inherently
accounts, to an adequate extent, for the presence of interloper galaxies which
are not bounded to a given cluster, the primary contaminant of dynamical mass
measurements. We validate and showcase the performance of our neural flow
approach to robustly infer the dynamical mass of clusters from a realistic mock
cluster catalogue. A key aspect of our novel algorithm is that it yields the
probability density function of the mass of a particular cluster, thereby
providing a principled way of quantifying uncertainties, in contrast to
conventional machine learning approaches. The neural network mass predictions,
when applied to a contaminated catalogue with interlopers, have a mean overall
logarithmic residual scatter of 0.028 dex, with a log-normal scatter of 0.126
dex, which goes down to 0.089 dex for clusters in the intermediate to high mass
range. This is an improvement by nearly a factor of four relative to the
classical cluster mass scaling relation with the velocity dispersion, and
outperforms recently proposed machine learning approaches. We also apply our
neural flow mass estimator to a compilation of galaxy observations of some
well-studied clusters with robust dynamical mass estimates, further
substantiating the efficacy of our algorithm.
