Aδ : Autodiff for Discontinuous Programs - Applied to Shaders

被引:2
|
作者
Yang, Yuting [1 ]
Barnes, Connelly [2 ]
Adams, Andrew [2 ]
Finkelstein, Adam [1 ]
机构
[1] Princeton Univ, Princeton, NJ 08544 USA
[2] Adobe Res, San Francisco, CA USA
来源
ACM TRANSACTIONS ON GRAPHICS | 2022年 / 41卷 / 04期
关键词
Automatic Differentiation; Differentiable Programming; Differentiable Rendering; Domain-Specific Language;
D O I
10.1145/3528223.3530125
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Over the last decade, automatic differentiation (AD) has profoundly impacted graphics and vision applications - both broadly via deep learning and specifically for inverse rendering. Traditional AD methods ignore gradients at discontinuities, instead treating functions as continuous. Rendering algorithms intrinsically rely on discontinuities, crucial at object silhouettes and in general for any branching operation. Researchers have proposed fully-automatic differentiation approaches for handling discontinuities by restricting to affine functions, or semi-automatic processes restricted either to invertible functions or to specialized applications like vector graphics. This paper describes a compiler-based approach to extend reverse mode AD so as to accept arbitrary programs involving discontinuities. Our novel gradient rules generalize differentiation to work correctly, assuming there is a single discontinuity in a local neighborhood, by approximating the prefiltered gradient over a box kernel oriented along a 1D sampling axis. We describe when such approximation rules are first-order correct, and show that this correctness criterion applies to a relatively broad class of functions. Moreover, we show that the method is effective in practice for arbitrary programs, including features for which we cannot prove correctness. We evaluate this approach on procedural shader programs, where the task is to optimize unknown parameters in order to match a target image, and our method outperforms baselines in terms of both convergence and efficiency. Our compiler outputs gradient programs in TensorFlow, PyTorch (for quick prototypes) and Halide with an optional auto-scheduler (for efficiency). The compiler also outputs GLSL that renders the target image, allowing users to interactively modify and animate the shader, which would otherwise be cumbersome in other representations such as triangle meshes or vector art.
引用
收藏
页数:24
相关论文
共 50 条
  • [1] To the Problem of Discontinuous Solutions in Applied Mathematics
    Vasiliev, Valery V. V.
    Lurie, Sergey A. A.
    [J]. MATHEMATICS, 2023, 11 (15)
  • [2] Direct Weight Optimization Applied to Discontinuous Functions
    Ohlsson, Henrik
    Roll, Jacob
    Brun, Anders
    Knutsson, Hans
    Andersson, Mats
    Ljung, Lennart
    [J]. 47TH IEEE CONFERENCE ON DECISION AND CONTROL, 2008 (CDC 2008), 2008, : 117 - 122
  • [3] ON THE ROLE OF APPLIED AND MISFIT STRESS IN DISCONTINUOUS PRECIPITATION
    DRYDEN, JR
    PURDY, GR
    [J]. ACTA METALLURGICA ET MATERIALIA, 1990, 38 (07): : 1255 - 1261
  • [4] Analysis of the discontinuous PWM strategies applied to the VSI
    Belbaz, S.
    Kadjoudj, M.
    Golea, N.
    [J]. ISCIII '07: 3RD INTERNATIONAL SYMPOSIUM ON COMPUTATIONAL INTELLIGENCE AND INTELLIGENT INFORMATICS, PROCEEDINGS, 2007, : 131 - +
  • [5] ANTHROPOLOGY APPLIED TO HEALTH PROGRAMS
    RUBEL, AJ
    [J]. SCIENCE, 1974, 185 (4150) : 545 - 545
  • [6] ANTHROPOLOGY APPLIED TO HEALTH PROGRAMS
    RUBEL, AJ
    [J]. SCIENCE, 1973, 180 (4084) : 429 - 429
  • [7] Viability theory applied to discontinuous ordinary differential equations
    Figueroa Sestelo, Ruben
    Lopez Pouso, Rodrigo
    [J]. MATHEMATICAL MODELS IN ENGINEERING, BIOLOGY AND MEDICINE, 2009, 1124 : 148 - 157
  • [8] Discontinuous Galerkin methods applied to shock and blast problems
    Chevaugeon, N
    Xin, J
    Hu, P
    Li, X
    Cler, D
    Flaherty, JE
    Shephard, MS
    [J]. JOURNAL OF SCIENTIFIC COMPUTING, 2005, 22-3 (01) : 227 - 243
  • [9] Discontinuous Galerkin Methods Applied to Shock and Blast Problems
    N. Chevaugeon
    J. Xin
    P. Hu
    X. Li
    D. Cler
    J.E. Flaherty
    M.S. Shephard
    [J]. Journal of Scientific Computing, 2005, 22-23 : 227 - 243
  • [10] Continuous/discontinuous Galerkin methods applied to elasticity problems
    do Carmo, E. G. Dutra
    Fernandes, M. T. C. Araujo
    Mansur, Webe Joao
    [J]. COMPUTER METHODS IN APPLIED MECHANICS AND ENGINEERING, 2014, 269 : 291 - 314