emmi_inference.models.upt ========================= .. py:module:: emmi_inference.models.upt .. autoapi-nested-parse:: WARNING This file is a 1:1 duplicate from the ``tutorial`` folder. It is here to avoid installation of a tutorial as a package and keep it isolated. Classes ------- .. autoapisummary:: emmi_inference.models.upt.UPT Module Contents --------------- .. py:class:: UPT(ndim, radius, dim, num_heads, depth, dec_depth, mlp_expansion_factor, norm_ctor = nn.LayerNorm, spool_pos_mode = 'abspos', use_physics_features = False, physics_dim = None, **kwargs) Bases: :py:obj:`emmi_inference.models.base_model.BaseModel` Implementation of the UPT (Universal Physics Transformer) model. :param BaseModel: Base model class that contains the utilities for all models we use in this tutorial. :param ndim: rank of the input data/tensor. :param input_dim: dimensionality of the input features. :param output_dim: dimensionality of the output features. :param radius: radius for the supernode pooling. :param dim: hidden dimensionality of the network. :param num_heads: number of attention heads. :param depth: depth (i.e., number of layers) of the encoder/approximator. :param dec_depth: number of decoder layers for the perceiver decoder. :param mlp_expansion_factor: expansion factor for the MLP in the transformer block. :param norm_ctor: cons. Defaults to nn.LayerNorm. :param spool_pos_mode: _description_. Defaults to "abspos". .. py:attribute:: encoder .. py:attribute:: blocks .. py:attribute:: pred .. py:method:: forward(surface_mask_query, surface_position_batch_idx, surface_position_supernode_idx, surface_position, query_position, surface_features = None) Forward pass of the UPT model. :param input_position: input coordinates of the surface points. :param surface_mask_query: surface mask for the query points, indicating which points are surface points. :param surface_position_batch_idx: batch indices for the surface positions, since the surface positions are a sparse tensor for the supernode pooling. :param surface_position_supernode_idx: supernode indices for the surface positions. :param geometry_position: geometry position information. :param query_position: input coordinates of the query points. :param surface_features: surface features for the input points. Defaults to None. :returns: dictionary with the output tensors, containing the surface pressure and volume velocity. :rtype: dict[str, torch.Tensor]