Normalizing Flows have emerged as a powerful brand of generative models, as they not only allow for efficient sampling of complicated target distributions, but also deliver density estimation by construction. We propose here an in-depth comparison of coupling and autoregressive flows, both of the affine and rational quadratic spline type, considering four different architectures: Real-valued Non-Volume Preserving (RealNVP), Masked Autoregressive Flow (MAF), Coupling Rational Quadratic Spline (C-RQS), and Autoregressive Rational Quadratic Spline (A-RQS). We focus on a set of multimodal target distributions of increasing dimensionality ranging from 4 to 400. The performances are compared by means of different test-statistics for two-sample tests, built from known distance measures: the sliced Wasserstein distance, the dimension-averaged one-dimensional Kolmogorov-Smirnov test, and the Frobenius norm of the difference between correlation matrices. Furthermore, we include estimations of the variance of both the metrics and the trained models. Our results indicate that the A-RQS algorithm stands out both in terms of accuracy and training speed. Nonetheless, all the algorithms are generally able, without too much fine-tuning, to learn complicated distributions with limited training data and in a reasonable time, of the order of hours on a Tesla A40 GPU. The only exception is the C-RQS, which takes significantly longer to train, does not always provide good accuracy, and becomes unstable for large dimensionalities. All algorithms have been implemented using TensorFlow2 and TensorFlow Probability and made available on \href{https://github.com/NF4HEP/NormalizingFlowsHD}{GitHub}.
翻译:归一化流作为一种强大的生成模型分支,不仅能高效采样复杂的目标分布,还能通过构造提供密度估计。本文对仿射型和有理二次样条型的耦合流与自回归流进行了深入比较,考虑了四种不同架构:实值非体积保持(RealNVP)、掩码自回归流(MAF)、耦合有理二次样条(C-RQS)和自回归有理二次样条(A-RQS)。我们聚焦于一组维度从4到400递增的多峰目标分布。通过基于已知距离度量的双样本检验的不同检验统计量(切片Wasserstein距离、维度平均的一维Kolmogorov-Smirnov检验以及相关矩阵差异的Frobenius范数)来比较性能。此外,我们还纳入了对度量指标和训练模型方差的估计。结果表明,A-RQS算法在精度和训练速度方面均表现突出。尽管如此,所有算法通常无需过多调参就能在有限训练数据下合理时间内(在Tesla A40 GPU上约数小时)学习复杂分布。唯一的例外是C-RQS,其训练时间显著更长,精度不一定理想,且在高维情况下变得不稳定。所有算法均使用TensorFlow2和TensorFlow Probability实现,并已在GitHub上开放获取。