You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 the intervenors: Mapping[Optional[str], Sequence[AbstractIntervenor]] field of any AbstractStagedModel.
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 in AbstractStagedModel, but this would violate the abstract-final pattern. We haven't been enforcing the pattern by subclassing equinox.Module with strict=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.
the intervene field, in all final subclasses of feedbax.task.AbstractTaskTrialSpec;
the intervention_specs and intervention_specs_validation fields in all final subclasses of AbstractTask;
the label field in all final subclasses of AbstractIntervenor—when we use schedule_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 (ModelInput and passing intervenor parameters to submodels #12). The user generally does not have to assign to this field.
The text was updated successfully, but these errors were encountered:
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 (ModelInput
and passing intervenor parameters to submodels #12). The user generally does not have to assign to this field.The text was updated successfully, but these errors were encountered: