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, the surrogate, 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 more traditional algorithms, our approach scales well to higher dimensions, which we demonstrate on problems with up to 35k interlinked variables.
翻译:基于梯度的优化方法目前广泛应用于图形学领域,但无法处理梯度未定义或为零的问题。为此,可通过人工设计具有相似最小值但可微的"替代"损失函数来规避该问题。我们提出的ZeroGrads框架通过自主学习目标函数的神经近似——替代函数,实现了该流程自动化,进而可对任意黑盒图形管线进行微分运算。我们在目标函数的主动平滑版本上训练替代函数,并强化其局部特性,使替代函数的表征能力聚焦于当前训练环节的关键区域。该拟合过程与参数优化同步在线进行,无需预计算数据或预训练模型,采用自监督方式。由于目标函数采样代价高昂(需完整渲染或模拟器运行),我们设计了高效采样方案,在实现可承受运行时间的同时保持竞争性性能,且额外开销极低。我们展示了在图形学中多个非凸、不可微黑盒问题上的优化能力,包括渲染中的可见性处理、程序化建模中的离散参数空间,以及物理驱动动画中的最优控制等场景。与传统算法相比,本方法在高维问题上表现出良好扩展性,我们已在包含多达35,000个耦合变量的难题上验证了其有效性。