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.


翻译:RooFit是用于统计建模和拟合的工具包,被粒子物理中大多数实验使用。随着下一代实验数据集的增长,物理分析的处理要求变得越来越具有计算要求,需要对RooFit进行性能优化。其中一种可能的加速最小化和增加稳定性的方法是使用自动微分(AD)。与数值微分不同,计算成本随参数数量线性缩放,使AD特别适用于具有许多参数的统计模型。在本文中,我们报告了在RooFit中实现AD的一种可能方法。我们的方法是添加一个自动生成C++代码的工具,用于完整的RooFit模型。与原始的RooFit模型不同,此生成代码不包含虚函数调用和其他RooFit特定的开销。特别地,该代码然后用于使用Clad自动产生梯度。Clad是作为clang编译器插件实现的源变换AD工具,可为输入的C++函数自动生成导数代码。我们展示了将此代码生成策略应用于HistFactory和其他常用的RooFit模型时观察到的改进结果。HistFactory是RooFit的一个子组件,它实现了基于直方图模板的概率密度的柱形似然模型。这些模型通常具有非常多的自由参数,因此是RooFit中首要支持AD的有趣目标。

0
下载
关闭预览

相关内容

在数学和计算机代数中,自动微分有时称作演算式微分,是一种可以借由计算机程序计算一个函数导数的方法。两种传统做微分的方法为:(1)对一个函数的表示式做符号上的微分,并且计算其在某一点上的值。(2)使用差分。使用符号微分最主要的缺点是速度慢及将计算机程序转换成表示式的困难。此外,很多函数在要计算更高阶微分时会变得复杂。 使用差分的两个重要的缺点是舍弃误差及数值化过程和相消误差。此两者传统方法在计算更高阶微分时,都有复杂度及误差增加的问题。自动微分则解决上述的问题。
不可错过!《机器学习100讲》课程,UBC Mark Schmidt讲授
专知会员服务
71+阅读 · 2022年6月28日
【2022新书】高效深度学习,Efficient Deep Learning Book
专知会员服务
115+阅读 · 2022年4月21日
专知会员服务
41+阅读 · 2020年12月18日
机器学习入门的经验与建议
专知会员服务
91+阅读 · 2019年10月10日
【SIGGRAPH2019】TensorFlow 2.0深度学习计算机图形学应用
专知会员服务
39+阅读 · 2019年10月9日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
26+阅读 · 2019年5月18日
逆强化学习-学习人先验的动机
CreateAMind
15+阅读 · 2019年1月18日
强化学习的Unsupervised Meta-Learning
CreateAMind
17+阅读 · 2019年1月7日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
【论文】变分推断(Variational inference)的总结
机器学习研究会
39+阅读 · 2017年11月16日
【推荐】SVM实例教程
机器学习研究会
17+阅读 · 2017年8月26日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
1+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
Arxiv
11+阅读 · 2022年9月1日
Arxiv
22+阅读 · 2022年2月4日
VIP会员
相关资讯
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
26+阅读 · 2019年5月18日
逆强化学习-学习人先验的动机
CreateAMind
15+阅读 · 2019年1月18日
强化学习的Unsupervised Meta-Learning
CreateAMind
17+阅读 · 2019年1月7日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
【论文】变分推断(Variational inference)的总结
机器学习研究会
39+阅读 · 2017年11月16日
【推荐】SVM实例教程
机器学习研究会
17+阅读 · 2017年8月26日
相关基金
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
1+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
Top
微信扫码咨询专知VIP会员