-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Labels
ATS ApprovedApproved by ATSApproved by ATSenhancementNew feature or requestNew feature or requestmodels
Description
Is your feature request related to a problem? Please describe.
Currently, mappers in anemoi-models are static: they receive the subgraph (edge indices & edge attributes) at initialisation, storing it as a mapper attribute. This design limits flexibility when applying the model to novel use cases (observations, multi-domain training, ...). Redesigning them to be dynamic, so that the subgraph is passed during forward(), would make mappers more extensible.
Should all mappers be strictly dynamic? Not necessarily. If benchmarks show a significant performance degradation when always passing the subgraph at forward(), we plan to introduce a caching mechanism. This would allow subgraphs to be stored and reused internally through specialised classes.
Current Status
self.encoder = instantiate(
model_config.model.encoder,
sub_graph=graph[(self._graph_name_data, "to", self._graph_name_hidden)],
**encoder_kwargs
...
)
x_data_latent, x_latent = self.encoder(
(x_data_latent, x_hidden_latent),
**kwargs
...
)
Proposed Solution
self.encoder = instantiate(
model_config.model.encoder,
**encoder_kwargs,
...
)
x_data_latent, x_latent = self.encoder(
(x_data_latent, x_hidden_latent),
edge_index=graph[(self._graph_name_data, "to", self._graph_name_hidden)].edge_index,
**kwargs,
...
)
ssmmnn11mchantry and matschreiner
Metadata
Metadata
Assignees
Labels
ATS ApprovedApproved by ATSApproved by ATSenhancementNew feature or requestNew feature or requestmodels
Type
Projects
Status
Next Up