-
-
Notifications
You must be signed in to change notification settings - Fork 161
Open
Labels
featureNew featureNew feature
Description
By providing support for lineax.AbstractLinearOperators in the vector field of a ControlTerm it may be possible to reduce the need for WeaklyDiagonalControlTerm and/or any other such specialised control terms.
The following gives a MWE:
class ControlTerm(_ControlTerm):
def prod(self, vf, control):
if isinstance(vf, lx.AbstractLinearOperator):
return jtu.tree_map(lambda _vf, _control: _vf.mv(_control), vf, control)
return jtu.tree_map(_prod, vf, control)
# These two are now equivalent.
ControlTerm(lx.DiagonalLinearOperator(jnp.array([1,2,3])), ...)
WeaklyDiagonalControlTerm(jnp.array([1,2,3]), ...)Not sure if this is something you want to support, but it occurred to me that the operator tags might also be useful for some of the diffrax solvers?
Metadata
Metadata
Assignees
Labels
featureNew featureNew feature