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

Inconsistency between parameter raising from `LayeredOpticalSystem` and `LayeredDetector` #262

Open LouisDesdoigts opened 8 months ago

LouisDesdoigts commented 8 months ago

The optical systems raise the leaves of the individual layers, whereas the detectors only raise the layer key.

Simple fix, add this to LayeredDetector.__getattr__

        for layer in list(self.layers.values()):
            if hasattr(layer, key):
                return getattr(layer, key)