emmi_inference.models.pipelines.shapenet_multistage

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

DataKeys

A central repository for data dictionary keys.

ShapenetMultistageCollator

A collator for the ShapeNet dataset that handles multi-stage data processing.

Module Contents

class emmi_inference.models.pipelines.shapenet_multistage.DataKeys

A central repository for data dictionary keys.

SURFACE_POS = 'surface_position'
VOLUME_POS = 'volume_position'
GEOMETRY_POS = 'geometry_position'
INPUT_POS = 'input_position'
SURFACE_MASK_INPUT = 'surface_mask_input'
PHYSICS_FEATURES = 'physics_features'
GEOMETRY_BATCH_IDX = 'geometry_batch_idx'
GEOMETRY_SUPERNODE_IDX = 'geometry_supernode_idx'
SURFACE_PRESSURE_TARGET = 'surface_pressure_target'
VOLUME_VELOCITY_TARGET = 'volume_velocity_target'
SURFACE_SDF = 'surface_sdf'
VOLUME_SDF = 'volume_sdf'
SURFACE_NORMALS = 'surface_normals'
VOLUME_NORMALS = 'volume_normals'
SURFACE_PRESSURE = 'surface_pressure'
VOLUME_VELOCITY = 'volume_velocity'
static as_query(key)

Converts a standard key to its ‘query’ equivalent.

Parameters:

key (str)

Return type:

str

as_target()

Converts a standard key to its ‘target’ equivalent.

Return type:

str

class emmi_inference.models.pipelines.shapenet_multistage.ShapenetMultistageCollator(dataset_statistics=None, num_surface_points=0, num_volume_points=0, num_geometry_supernodes=0, num_surface_queries=0, num_volume_queries=0, sample_query_points=True, num_geometry_points=0, num_supernodes=0, num_volume_anchor_points=0, num_surface_anchor_points=0, use_physics_features=False, seed=None, volume_features_modes=None, surface_features_modes=None, surface_target_modes=None, volume_target_modes=None, radius_graph_r=None, radius_graph_max_num_neighbors=None, use_gino_precollators=False, **kwargs)

Bases: ksuit.data.pipeline.MultiStagePipeline

A collator for the ShapeNet dataset that handles multi-stage data processing. This class is designed for all baseline models in the AB-UPT project.

_summary_

Parameters:
  • dataset – instance of the dataset to be used with the collator to retrieve the normalization stats.

  • num_surface_points (int) – number of surface points we sample as input for the encoder. Defaults to 0.

  • num_volume_points (int) – number of volume points we sample as input for the encoder. Defaults to 0.

  • num_geometry_supernodes (int) – number of geometry supernodes (for AB-UPT). Defaults to 0.

  • num_surface_queries (int) – number of surface queries we use to query the output function. Defaults to 0. If set to 0, no query points are sampled.

  • num_volume_queries (int) – number of volume queries to query the output function. Defaults to 0. If set to 0, no query points are sampled.

  • sample_query_points (bool) – whether to sample query points. Defaults to True. If False, the query points are simply duplicated from the surface and volume points.

  • num_geometry_points (int) – number of points we sample from the geometry (for AB-UPT). Defaults to 0. This is different than the input to the surface branch.

  • num_supernodes (int) – Number of supernodes we use (for UPT and AB-UPT). Defaults to 0.

  • num_volume_anchor_points (int) – Number of volume anchor points to sample for AB-UPT. Defaults to 0.

  • num_surface_anchor_points (int) – Number of surface anchor points to sample for AB-UPT. Defaults to 0.

  • use_physics_features (bool) – Whether to use physics features next to input coordinates (i.e., SDF and normal vectors). Defaults to False.

  • seed (int) – Random seed. Defaults to None.

  • volume_features_modes (list[str]) – Volume features modes, i.e., which modes in the dataset are considered as ‘features’ for volumes points (next to the input coordinates). Defaults to None.

  • surface_features_modes (list[str]) – Surface features modes, i.e., which modes in the dataset are considered as ‘features’ for surface points (next to the input coordinates). Defaults to None.

  • surface_target_modes (list[str]) – Surface target modes, i.e., which modes in the dataset are considered as ‘targets’ for surface points (next to the input coordinates). Defaults to None.

  • volume_target_modes (list[str]) – Volume target modes, i.e., which modes in the dataset are considered as ‘targets’ for volume points. Defaults to None.

  • radius_graph_r (int | None) – Radius graph radius. Defaults to None.

  • radius_graph_max_num_neighbors (int | None) – Radius graph max number of neighbors. Defaults to None.

  • use_gino_precollators (bool) – Whether to use GINO precollators. Defaults to False.

  • dataset_statistics (dict[str, collections.abc.Sequence[float]])

property has_query_points: bool

Check if any query points are specified.

Return type:

bool

property use_anchor_points: bool

Check if anchor points are used instead of standard sampling.

Return type:

bool

dataset_statistics = None
seed = None
num_surface_points = 0
num_volume_points = 0
num_surface_queries = 0
num_volume_queries = 0
sample_query_points = True
num_supernodes = 0
num_volume_anchor_points = 0
num_surface_anchor_points = 0
num_geometry_points = 0
num_geometry_supernodes = 0
use_query_positions = False
use_physics_features = False
surface_features
volume_features
surface_targets
volume_targets
radius_graph_r = None
radius_graph_max_num_neighbors = None
use_gino_precollators = False