Gradient-based optimization is now ubiquitous across graphics, but unfortunately can not be applied to problems with undefined or zero gradients. To circumvent this issue, the loss function can be manually replaced by a ``surrogate'' that has similar minima but is differentiable. Our proposed framework, ZeroGrads, automates this process by learning a neural approximation of the objective function, which in turn can be used to differentiate through arbitrary black-box graphics pipelines. We train the surrogate on an actively smoothed version of the objective and encourage locality, focusing the surrogate's capacity on what matters at the current training episode. The fitting is performed online, alongside the parameter optimization, and self-supervised, without pre-computed data or pre-trained models. As sampling the objective is expensive (it requires a full rendering or simulator run), we devise an efficient sampling scheme that allows for tractable run-times and competitive performance at little overhead. We demonstrate optimizing diverse non-convex, non-differentiable black-box problems in graphics, such as visibility in rendering, discrete parameter spaces in procedural modelling or optimal control in physics-driven animation. In contrast to other derivative-free algorithms, our approach scales well to higher dimensions, which we demonstrate on problems with up to 35k interlinked variables.
翻译:基于梯度的优化在图形学中已无处不在,但遗憾的是无法应用于梯度未定义或为零的问题。为解决此问题,通常需手动将损失函数替换为具有相似最小值但可微分的"替代函数"。我们提出的框架ZeroGrads通过学习目标函数的神经近似来自动化这一过程,从而可对任意黑盒图形管线进行微分。我们基于主动平滑的目标函数版本训练替代函数,并鼓励其保持局部性,将替代函数的学习能力集中于当前训练阶段的关键区域。该拟合过程在线执行,与参数优化同步进行,且具有自监督特性,无需预计算数据或预训练模型。由于对目标函数进行采样代价高昂(需完整渲染或模拟器运行),我们设计了一种高效采样方案,在可接受运行时间内实现具有竞争力的性能,且额外开销极低。我们展示了图形学中多种非凸、非可微黑盒问题的优化案例,包括渲染中的可见性计算、程序化建模中的离散参数空间探索,以及物理驱动动画中的最优控制。与其它无导数算法相比,我们的方法能更好地扩展到高维问题——我们已在含35,000个相互关联变量的优化问题上验证了这一能力。