LouisDesdoigts / dLux

Differentiable optical models as parameterised neural networks in Jax using Zodiax
https://louisdesdoigts.github.io/dLux/
BSD 3-Clause "New" or "Revised" License
43 stars 6 forks source link

Create `geometry.py`. #180

Closed Jordan-Dennis closed 1 year ago

Jordan-Dennis commented 1 year ago

Hi all, This one will please @LouisDesdoigts! I'm going to do this today/tomorrow since while optimising the code I was just working with functions. This will make it much easier for me to integrate my optimisations and I know it was @LouisDesdoigts long term plan anyway. Regards Jordan.

LouisDesdoigts commented 1 year ago

Love to see it!

Depending on the size of this (especially if you do the custom jvp stuff in #181) it might make sense to have this exist as its own package, but its up to you really!

Jordan-Dennis commented 1 year ago

I don't think so :laughing:, when I pulled everything out it was only a few hundred lines (no comments :grimacing:). #181 might not work as well as I thought it would since the output is a matrix and I am not sure how to deal with that.

LouisDesdoigts commented 1 year ago

I was imagining the basis stuff would go in there too, its all pretty general functionality

Jordan-Dennis commented 1 year ago

Yeah, I was thinking of a rather interesting idea actually, which was parametrising the edges of apertures by lines (i.e. mappings of 1D polynomials like gauss-legendre into 2D space). This would be to try and learn dents on the edge of an aperture/pupil. Not sure if we need this but I thought it was a cool idea.

benjaminpope commented 1 year ago

This is how they do it in https://arxiv.org/abs/2010.05978. But it is not an approach I suggest will be useful here in the short term.

Jordan-Dennis commented 1 year ago

Yeah, my priority is trying to eek out some speed so that I can actually learn things about the forwards model.

LouisDesdoigts commented 1 year ago

Decided against in 0.13