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

Make a `BaseLayer` class to hold the `name` parameter #210

Closed LouisDesdoigts closed 1 year ago

LouisDesdoigts commented 1 year ago

Tied in the with investigation of removing static filed name parameters as part of the observation branch, and the development of the optimisation module of zodaix that pre-filters non array leaves from models.

This would allow for the names/keys to be serialisable which is relatively important.

LouisDesdoigts commented 1 year ago

This would also make the name/keys updatable, which would require the changing of the dictionary key. This may need to implemented at the zodiax level.

Something like this

def change_key(self, old, new):
    for _ in range(len(self)):
        k, v = self.popitem(False)
        self[new if old == k else k] = v
LouisDesdoigts commented 1 year ago

No longer needed as the name parameter has been removed package wide.