This PR overhauls our trainable selection. We now have a simple Trainable class which just wraps any value, and comes from trainable so the API is the same. Also overhauls the internal structure - we can now register non-trainable parameters which are callables too (for example, non-traineable phasemask based on field shape).
This slightly changes how to train as we now need to separate trainable and non-trainable parameters from each other - I've also updated the notebook about training. This doesn't change much as the Propagation method was already using variables to cache the propagator.
This PR overhauls our trainable selection. We now have a simple
Trainable
class which just wraps any value, and comes fromtrainable
so the API is the same. Also overhauls the internal structure - we can now register non-trainable parameters which are callables too (for example, non-traineable phasemask based on field shape).This slightly changes how to train as we now need to separate trainable and non-trainable parameters from each other - I've also updated the notebook about training. This doesn't change much as the
Propagation
method was already using variables to cache the propagator.