chromatix-team / chromatix

Differentiable wave optics using JAX! Documentation can be found at https://chromatix.readthedocs.io
MIT License
77 stars 13 forks source link

Bit depth change and thresholding using the surrogate gradient approach #85

Closed hosseybposh closed 1 year ago

hosseybposh commented 1 year ago

In utils.utils two functions (threshold and digitize) are added that enable differentiable thresholding and bit depth manipulation.

For both of them, surrogate gradients are used. For thresholding, the gradients of the sigmoid function are used. For digitization pass-through approach is used.