使用 RooFit 和 Clad 实现分箱似然的自动微分
Automatic Differentiation of Binned Likelihoods With Roofit and Clad
AI总结:
本文提出在 RooFit 中利用 Clad 自动生成 C++ 代码以实现自动微分,消除虚函数开销并提升多参数分箱似然模型(如 HistFactory)的计算性能与稳定性。
摘要:
RooFit 是一个用于统计建模和拟合的工具包,被粒子物理学中的大多数实验所使用。随着下一代实验数据集的增长,物理分析的处理要求变得更加计算密集,因此需要对 RooFit 进行性能优化。加速最小化并增加稳定性的一种可能方法是使用自动微分(AD)。与数值微分不同,其计算成本随参数数量线性增长,这使得 AD 对具有许多参数的统计模型特别有吸引力。在本文中,我们报告了在 RooFit 中实现 AD 的一种可能方法。我们的方法是添加一种设施,自动为完整的 RooFit 模型生成 C++ 代码。与原始的 RooFit 模型不同,此生成的代码没有虚函数调用和其他 RooFit 特定的开销。特别是,此代码随后用于通过 Clad 自动生成梯度。Clad 是一个源转换 AD 工具,作为 clang 编译器的插件实现,它自动为输入的 C++ 函数生成导数代码。我们展示了将此代码生成策略应用于 HistFactory 和其他常用 RooFit 模型时所观察到的改进结果。HistFactory 是 RooFit 的子组件,它使用基于直方图模板的概率密度实现分箱似然模型。这些模型通常具有非常多的自由参数,因此是 RooFit 中 AD 支持的首个有趣目标。
英文摘要:
RooFit is a toolkit for statistical modeling and fitting used by most experiments in particle physics. Just as data sets from next-generation experiments grow, processing requirements for physics analysis become more computationally demanding, necessitating performance optimizations for RooFit. One possibility to speed-up minimization and add stability is the use of Automatic Differentiation (AD). Unlike for numerical differentiation, the computation cost scales linearly with the number of parameters, making AD particularly appealing for statistical models with many parameters. In this paper, we report on one possible way to implement AD in RooFit. Our approach is to add a facility to generate C++ code for a full RooFit model automatically. Unlike the original RooFit model, this generated code is free of virtual function calls and other RooFit-specific overhead. In particular, this code is then used to produce the gradient automatically with Clad. Clad is a source transformation AD tool implemented as a plugin to the clang compiler, which automatically generates the derivative code for input C++ functions. We show results demonstrating the improvements observed when applying this code generation strategy to HistFactory and other commonly used RooFit models. HistFactory is the subcomponent of RooFit that implements binned likelihood models with probability densities based on histogram templates. These models frequently have a very large number of free parameters and are thus an interesting first target for AD support in RooFit.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。