I’ve been writing a lot of PyTorch lately and taking derivatives of unexpected things and had the fun idea to write a path tracer in PyTorch. It made sense to me – most of ray tracing is differentiable most of the time, and benefits a ton from being GPU parallelized. I did it, it works, and gets some speed benefit. It turns out that I’m not the first person to have this idea, and there are ray tracers written in Theano and Tensorflow. This one is distinguished primarily by being a path tracer (runs indefinitely to get a progressively more accurate result, rendering things like caustics and global illumination), using MCMC methods, and being written for PyTorch.
Disclaimer: This is by no means a competitive real time ray-tracer and there are a huge number of improvements that would have to be made to bring it to that level. It still might be useful in that with some small modifications, you could throw it into a neural network.