We implemented the 2D, and 3D customized CUDA kernel of the triple backward grid sampler that supports cosine, linear, and smoothstep kernel (Thomas Müller) and third-order gradients $u_{xxc}, u_{yyc}$ with second-order gradients (Tymoteusz Bleja). As a result, the runtime and the memory requirement were significantly reduced. It is used in https://github.com/NamGyuKang/PIXEL
The code is tested with Python3 environment (3.8, 3.9) and PyTorch (1.11, 11.2) with CUDA (>=11.3).
pip install git+https://github.com/NamGyuKang/CosineSampler.git
You can choose the kernel (cosine, linear, smoothstep), and the multicell (True, False). The multicell is used in PIXEL (Physics-Informed Cell Representation), and if you set the multicell False, and linear kernel, it is the same with Pytorch grid_sample and our CosineSampler support triple backpropagation of kernel.
Second-order PDE (Helmholtz equation)
If you use this code for research, please consider citing:
@article{kang2023pixel,
title={PIXEL: Physics-Informed Cell Representations for Fast and Accurate PDE Solvers},
author={Kang, Namgyu and Lee, Byeonghyeon and Hong, Youngjoon and Yun, Seok-Bae and Park, Eunbyung},
journal={Proceedings of the AAAI Conference on Artificial Intelligence},
year={2023}}