noether.modeling.models.upt¶
Classes¶
Module Contents¶
- class noether.modeling.models.upt.UPTConfig(/, **data)¶
Bases:
noether.core.models.base.ModelBaseConfig,noether.core.schemas.mixins.InjectSharedFieldFromParentMixinConfiguration for a UPT model.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Hidden dimension of the model.
- supernode_pooling_config: Annotated[noether.modeling.modules.encoders.supernode_pooling.SupernodePoolingConfig, noether.core.schemas.mixins.Shared]¶
- approximator_config: Annotated[noether.modeling.modules.blocks.transformer.TransformerBlockConfig, noether.core.schemas.mixins.Shared]¶
- decoder_config: Annotated[noether.modeling.modules.decoders.deep_perceiver.DeepPerceiverDecoderConfig, noether.core.schemas.mixins.Shared]¶
- data_specs: noether.data.schemas.ModelDataSpecs¶
- linear_output_projection_config()¶
- rope_frequency_config()¶
- validate_rope_usage()¶
Ensure that if use_rope is True in the main config, it is also True in the approximator_config.
- Return type:
- pos_embedding_config()¶
- class noether.modeling.models.upt.UPT(config)¶
Bases:
torch.nn.ModuleImplementation of the UPT (Universal Physics Transformer) model.
- Parameters:
config (UPTConfig) – Configuration for the UPT model. See
UPTConfigfor details.
- use_rope¶
- encoder¶
- pos_embed¶
- approximator_blocks¶
- decoder¶
- norm¶
- prediction_layer¶
- compute_rope_args(geometry_batch_idx, geometry_position, geometry_supernode_idx, query_position)¶
Compute the RoPE frequency arguments for the geometry and query positions. If RoPE is not used, return empty dicts.
- Parameters:
geometry_batch_idx (torch.Tensor)
geometry_position (torch.Tensor)
geometry_supernode_idx (torch.Tensor)
query_position (torch.Tensor)
- Return type:
tuple[dict[str, torch.Tensor], dict[str, torch.Tensor]]
- forward(geometry_batch_idx, geometry_supernode_idx, geometry_position, query_position)¶
Forward pass of the UPT model.
- Parameters:
geometry_batch_idx (torch.Tensor) – Batch indices for the geometry positions.
geometry_supernode_idx (torch.Tensor) – Supernode indices for the geometry positions.
geometry_position (torch.Tensor) – Input coordinates of the geometry mesh points.
query_position (torch.Tensor) – Input coordinates of the query points.
- Returns:
Output tensor containing the predictions at query positions.
- Return type: