Open mlprt opened 6 months ago
This should be simplified/obviated if we replace the staged model approach with a DAG approach (#28), so I'm tagging this issue as "won't fix".
In particular, intervenors will have a similar status as any other leaf modules.
As mentioned in #19, intervention operations are prepended to the existing stages of a model's state operations. The intervention operations are defined by inserting
AbstractIntervenor
objects into theintervenors: Mapping[Optional[str], Sequence[AbstractIntervenor]]
field of anyAbstractStagedModel
.Currently, every subclass of
AbstractStagedModel
needs to implement that field. This is annoying: the field is generally just an empty dict that is later filled up with stuff, so it is always implemented in the same way. Developers are expected to repeat themselves.We could avoid this by implementing
intervenors
directly inAbstractStagedModel
, but this would violate the abstract-final pattern. We haven't been enforcing the pattern by subclassingequinox.Module
withstrict=True
, yet.Is there a way to avoid implementing
intervenors
in the base class?There are a few other places this same issue appears in Feedbax.
intervene
field, in all final subclasses offeedbax.task.AbstractTaskTrialSpec
;intervention_specs
andintervention_specs_validation
fields in all final subclasses ofAbstractTask
;label
field in all final subclasses ofAbstractIntervenor
—when we useschedule_intervenor
, this is used to assign a unique label to each intervenor among all the intervenors belonging to a model, so that it can be matched up with its trial-by-trial parameters, which are specified as a flat PyTree (#12). The user generally does not have to assign to this field.