MCPcopy Create free account

hub / github.com/Qualcomm-AI-research/geometric-algebra-transformer / functions

Functions452 in github.com/Qualcomm-AI-research/geometric-algebra-transformer

↓ 56 callersMethodto
Send to device. Overwritten to also move the CliffordAlgebra object, which is not an nn.Module.
gatr/experiments/nbody/wrappers.py:469
↓ 31 callersFunctiongeometric_product
Computes the geometric product f(x,y) = xy. Parameters ---------- x : torch.Tensor with shape (..., 16) First input multivector.
gatr/primitives/bilinear.py:46
↓ 22 callersFunctioncheck_pin_equivariance
Checks whether a callable is equivariant with respect to the Pin(3,0,1) or Spin(3,0,1) group. The callable can have an arbitray number of multive
tests/helpers/equivariance.py:25
↓ 19 callersFunctionembed_point
Embeds 3D points in multivectors. We follow the convention used in the reference below and map points to tri-vectors. References -------
gatr/interface/point.py:13
↓ 18 callersMethod_get_checkout_path
(self)
docker/ext_packages/install_upstream_python_packages.py:91
↓ 18 callersFunctionto_nd
Make tensor n-dimensional, group extra dimensions in first.
gatr/utils/tensors.py:19
↓ 14 callersFunctionmv_list_to_tensor
Transforms a list of multivector objects to a torch.Tensor.
gatr/utils/clifford.py:32
↓ 12 callersFunctionextract_point
Given a multivector, extract any potential 3D point from the trivector components. Nota bene: if the output is interpreted a regular R^3 point,
gatr/interface/point.py:48
↓ 11 callersFunctionembed_translation
Embeds a 3D translation in multivectors. In our convention, a translation vector is embedded into a combination of the scalar and bivector co
gatr/interface/translation.py:10
↓ 9 callersFunctionembed_scalar
Embeds a scalar tensor into multivectors. Parameters ---------- scalars: torch.Tensor with shape (..., 1) Scalar inputs. Ret
gatr/interface/scalar.py:6
↓ 9 callersFunctionreverse
Computes the reversal of a multivector. The reversal has the same scalar, vector, and pseudoscalar components, but flips sign in the bivector
gatr/primitives/linear.py:166
↓ 8 callersFunctionembed_oriented_plane
Embeds an (oriented plane) in the PGA. Following L. Dorst, the plane is represent as PGA vectors. References ---------- Leo Dorst, "
gatr/interface/plane.py:10
↓ 8 callersFunctionextract_oriented_plane
Extracts the normal on an oriented plane from a multivector. Currently, this function does *not* extract a support point for the plane (or the di
gatr/interface/plane.py:50
↓ 7 callersFunction_sample_list_of_mv
Utility function that samples a list of multivectors.
tests/helpers/geometric_algebra.py:13
↓ 7 callersFunctionlog_mlflow
Logs metric or param to MLflow. Catches exceptions due to locked or unavailable DB and then retries. Parameters ---------- key : str
gatr/utils/mlflow.py:21
↓ 6 callersFunctiondual
Computes the dual of `inputs` (non-equivariant!). See Table 4 in the reference. References ---------- Leo Dorst, "A Guided Tour to t
gatr/primitives/dual.py:134
↓ 6 callersFunctionembed_rotation
Embeds 3D rotations in multivectors. We follow the convention used in Leo Dorst, "A Guided Tour to the Plane-Based Geometric Algebra PGA", an
gatr/interface/rotation.py:6
↓ 6 callersFunctionfrequency_check
Checks whether an action should be performed at a given step and frequency. If `include_fractional` is given, the check also returns True when
gatr/utils/misc.py:25
↓ 6 callersMethodtrain
High-level training function.
gatr/experiments/base_experiment.py:168
↓ 5 callersMethod__init__
(self, in_channels, hidden_channels, num_heads)
gatr/baselines/transformer.py:54
↓ 5 callersFunctionembed_reflection
Embeds the reflection on a plane in multivectors. Following L. Dorst, this is represented as a PGA vector. References ---------- Leo
gatr/interface/reflection.py:11
↓ 5 callersFunctionextract_point_embedding_reg
Given a multivector x, returns |x_{123}| - 1. Put differently, this is the deviation of the norm of a pseudoscalar component from 1. This can
gatr/interface/point.py:102
↓ 5 callersFunctionextract_scalar
Extracts scalar components from multivectors. Parameters ---------- multivectors: torch.Tensor with shape (..., 16) Multivector i
gatr/interface/scalar.py:30
↓ 5 callersFunctiongatr_einsum
Computes torch.einsum with contraction path caching if enabled (and compilation is not used). Cf. `enable_cached_einsum` for more context.
gatr/utils/einsum.py:74
↓ 5 callersFunctiongenerate_dataset
Samples from n-body simulator and stores the results at `filename`.
scripts/generate_nbody_dataset.py:13
↓ 5 callersFunctiongrade_dropout
Multivector dropout, dropping out grades independently. Parameters ---------- x : torch.Tensor with shape (..., 16) Input data.
gatr/primitives/dropout.py:8
↓ 5 callersFunctioninner_product
Computes the inner product of multivectors f(x,y) = <x, y> = <~x y>_0. Sums over the 16 multivector dimensions. Equal to `geometric_product(
gatr/primitives/invariants.py:43
↓ 5 callersFunctionnorm
Computes the GA norm of an input multivector. Equal to sqrt(inner_product(x, x)). NOTE: this primitive is not used widely in our architectur
gatr/primitives/invariants.py:76
↓ 4 callersMethod__init__
(self, net)
gatr/experiments/nbody/wrappers.py:71
↓ 4 callersMethod_compute_metrics
Given a dataloader, computes all relevant metrics. Can be adapted by subclasses. Parameters ---------- dataloader : torch.uti
gatr/experiments/base_experiment.py:656
↓ 4 callersFunction_compute_pin_equi_linear_basis
Constructs basis elements for Pin(3,0,1)-equivariant linear maps between multivectors. This function is cached. Parameters ----------
gatr/primitives/linear.py:10
↓ 4 callersFunction_make_segnn_irreps
Creates an Irreps object for SEGNNModel given a number of O(3) vectors and scalars.
gatr/baselines/segnn.py:39
↓ 4 callersFunctionblock
GATrBlock fixture for testing
tests/gatr/layers/test_gatr_block.py:19
↓ 4 callersMethodcast
Casts an object as MLPConfig.
gatr/layers/mlp/config.py:37
↓ 4 callersFunctionenable_cached_einsum
Selects whether to use caching of optimal paths in einsum contraction computations. When using torch.compile (torch==2.2.1), if we specify the pr
gatr/utils/einsum.py:90
↓ 4 callersFunctiongeometric_attention
Equivariant geometric attention based on scaled dot products and nonlinear aux features. This is the main attention mechanism used in GATr. Thank
gatr/primitives/attention.py:284
↓ 4 callersFunctionget_first_output
Extracts the first output of a tuple of multiple outputs. If only one output is present, returns that. This is convenient for equivariance c
tests/helpers/equivariance.py:10
↓ 4 callersFunctiongrade_involute
Computes the grade involution of a multivector. The reversal has the same scalar, bivector, and pseudoscalar components, but flips sign in the
gatr/primitives/linear.py:185
↓ 4 callersFunctionouter_product
Computes the outer product `f(x,y) = x ^ y`. Parameters ---------- x : torch.Tensor with shape (..., 16) First input multivector.
gatr/primitives/bilinear.py:71
↓ 4 callersFunctionrandom_quaternion
Returns a unit quaternion, uniformly sampled from the 3-sphere.
gatr/utils/quaternions.py:35
↓ 4 callersFunctionrun_successfully
Executes command in a subprocess, and in case of errors, prints stdout/stderr and fails.
docker/ext_packages/install_upstream_python_packages.py:260
↓ 3 callersFunction_load_bilinear_basis
Loads basis elements for Pin-equivariant bilinear maps between multivectors. Parameters ---------- kind : {"gp", "outer"} Filenam
gatr/primitives/bilinear.py:13
↓ 3 callersMethod_load_dataset
Loads dataset. To be implemented by subclasses. Parameters ---------- tag : str Dataset tag, like "train", "val",
gatr/experiments/base_experiment.py:727
↓ 3 callersMethod_make_data_loader
Creates a data loader. Parameters ---------- dataset : torch.nn.utils.data.Dataset Dataset. batch_size :
gatr/experiments/base_experiment.py:543
↓ 3 callersFunctioncheck_pin_invariance
Checks whether a callable is invariant with respect to the Pin(3,0,1) or Spin(3,0,1) group. Parameters ---------- function: Callable
tests/helpers/equivariance.py:89
↓ 3 callersFunctionconstruct_reference_multivector
Constructs a reference vector for the equivariant join. Parameters ---------- reference : Tensor with shape (..., 16) or {"data", "canoni
gatr/utils/tensors.py:57
↓ 3 callersFunctionembed_pseudoscalar
Embeds a pseudoscalar tensor into multivectors. Parameters ---------- pseudoscalars: torch.Tensor with shape (..., 1) Pseudoscala
gatr/interface/pseudoscalar.py:6
↓ 3 callersFunctionequivariant_join
Computes the equivariant join. ``` equivariant_join(x, y; reference) = reference_123 * dual( dual(x) ^ dual(y) ) ``` This function u
gatr/primitives/dual.py:164
↓ 3 callersFunctionextract_pseudoscalar
Extracts pseudoscalar components from multivectors. Nota bene: when the output is interpreted as a scalar, this function is only equivariant
gatr/interface/pseudoscalar.py:30
↓ 3 callersFunctionscaled_dot_product_attention
Execute (vanilla) scaled dot-product attention. Dynamically dispatch to xFormers if attn_mask is an instance of xformers.ops.AttentionBias or
gatr/primitives/attention.py:433
↓ 2 callersMethod__init__
( self, in_shape, out_shape, hidden_channels, hidden_layers, a
gatr/baselines/gcan.py:69
↓ 2 callersFunction_build_dist_vec
Build 5D vector whose inner product with another such vector computes the squared distance. Parameters ---------- tri: Tensor Bat
gatr/primitives/attention.py:242
↓ 2 callersFunction_cached_einsum
Computes einsum whilst caching the optimal contraction path. Inspired by upstream https://github.com/pytorch/pytorch/blob/v1.13.0/torch/funct
gatr/utils/einsum.py:30
↓ 2 callersFunction_cast_in
Casts a single input to at least 32-bit precision.
gatr/utils/misc.py:209
↓ 2 callersFunction_cast_out
Casts a single output to desired precision.
gatr/utils/misc.py:220
↓ 2 callersFunction_compute_efficient_join
Constructs a kernel for the join operation. The kernel is such that join(x, y)_i = einsum(kernel_ijk, x_j, x_k). For now, we do this in the
gatr/primitives/dual.py:46
↓ 2 callersFunction_compute_reversal
Constructs a matrix that computes multivector reversal. Parameters ---------- device : torch.device Device dtype : torch.dtyp
gatr/primitives/linear.py:67
↓ 2 callersMethod_forward
Model forward pass. To be implemented by subclasses. Parameters ---------- data : tuple of torch.Tensor Data batc
gatr/experiments/base_experiment.py:742
↓ 2 callersMethod_initialize_logger
Initializes logging.
gatr/experiments/base_experiment.py:420
↓ 2 callersMethod_prep_data
Data preparation during training loop, e.g. to move data to correct device and dtype.
gatr/experiments/base_experiment.py:562
↓ 2 callersMethod_silence_the_lambs
Silences other loggers.
gatr/experiments/base_experiment.py:479
↓ 2 callersFunctionassert_equal
Assert all values in sequence are equal.
gatr/utils/tensors.py:24
↓ 2 callersFunctionbuild_attention_mask
Construct attention mask from pytorch geometric batch. Parameters ---------- inputs : torch_geometric.data.Batch Data batch.
gatr/experiments/arteries/wrappers.py:11
↓ 2 callersFunctioncompile_equi_linear
Transform EquiLinear module to equivalent CompiledLinear module. Used for fast inference, not trainable! Parameters ---------- equi_
gatr/utils/compile_linear.py:83
↓ 2 callersFunctioncompile_equi_linear_submodules
Replace all EquiLinear submodules in module with compiled version. Parameters ---------- model : nn.Module Model whose EquiLinear
gatr/utils/compile_linear.py:139
↓ 2 callersMethodcreate_model
Create self.model according to the specification in self.cfg.
gatr/experiments/base_experiment.py:116
↓ 2 callersFunctionefficient_equivariant_join
Computes the equivariant join, using the efficient implementation. ``` equivariant_join(x, y; reference) = reference_123 * dual( dual(x) ^ du
gatr/primitives/dual.py:221
↓ 2 callersFunctionembed_nbody_data_in_pga
Represent the n-body initial state in PGA multivectors. Masses are represented as scalars, positions as trivectors, and velocities as bivectors
gatr/experiments/nbody/wrappers.py:25
↓ 2 callersFunctionembed_pluecker_ray
Embed ray in Plücker coordinates as a multivector. Plücker coords are (v, o x v) for ray through o in direction v. Args: pluecker_ra
gatr/interface/ray.py:7
↓ 2 callersFunctionequi_layer_norm
Equivariant LayerNorm for multivectors. Rescales input such that `mean_channels |inputs|^2 = 1`, where the norm is the GA norm and the mean g
gatr/primitives/normalization.py:10
↓ 2 callersFunctionequi_linear
Pin-equivariant linear map f(x) = sum_{a,j} coeffs_a W^a_ij x_j. The W^a are 9 pre-defined basis elements. Parameters ---------- x :
gatr/primitives/linear.py:112
↓ 2 callersFunctionexpand_pairwise
Expand tensors to largest, optionally excluding some axes.
gatr/utils/tensors.py:9
↓ 2 callersFunctionexplicit_equivariant_join
Computes the equivariant join, using the explicit, but slow, implementation. ``` equivariant_join(x, y; reference) = reference_123 * dual( du
gatr/primitives/dual.py:195
↓ 2 callersFunctionextract_rotation
Extracts the represented rotation quaternion from the multivector's bivector components. Parameters ---------- multivector : torch.Tensor
gatr/interface/rotation.py:46
↓ 2 callersMethodforward
Compute cross attention. Parameters ---------- multivectors_kv : torch.Tensor with shape (..., num_items_kv, channels_in, 16)
gatr/layers/attention/cross_attention.py:97
↓ 2 callersFunctionget_device
Gets CUDA if available, CPU else.
gatr/utils/misc.py:20
↓ 2 callersFunctiongrade_project
Projects an input tensor to the individual grades. The return value is a single tensor with a new grade dimension. NOTE: this primitive is n
gatr/primitives/linear.py:136
↓ 2 callersFunctionjoin_norm
Computes the norm of the join, `|join(x,y)|`, in a single operation. Optionally: - computes the squared norm instead of the norm (when `squar
gatr/primitives/dual.py:250
↓ 2 callersFunctionmaximum_dtype
Return dtype with maximum precision. Cached. Compatible with compilation.
gatr/utils/misc.py:155
↓ 2 callersFunctionmodels_weights_are_close
Checks whether models have close weights.
gatr/utils/misc.py:294
↓ 2 callersFunctionnp_to_mv
Shorthand to transform a numpy array to a PGA multivector.
gatr/utils/clifford.py:13
↓ 2 callersFunctionpga_attention
Equivariant geometric attention based on scaled dot products and the equivariant join. Expects both multivector and scalar queries, keys, and val
gatr/primitives/attention.py:98
↓ 2 callersMethodpostprocess_results
Postprocesses the outputs extracted from the GA representation. To be implemented by subclasses, optionally (by default, no postprocessing is
gatr/experiments/base_wrapper.py:125
↓ 2 callersFunctionquaternion_to_rotation_matrix
Normalises q and maps to group matrix. Assumes [x y z w] quaternion format with ij=k (Hamilton) convention.
gatr/utils/quaternions.py:41
↓ 2 callersFunctionreturn_input_dtypes
(*args, **kwargs)
tests/gatr/utils/test_misc.py:17
↓ 2 callersFunctionsample_log_uniform
Samples log-uniformly from (min_, max_).
gatr/utils/misc.py:97
↓ 2 callersMethodsave_model
Save model in experiment folder. Parameters ---------- filename : None or str Filename to save the model to.
gatr/experiments/base_experiment.py:318
↓ 2 callersFunctionseed_all
Seeds all known sources of pseudo-randomness in our stack.
gatr/utils/misc.py:287
↓ 2 callersFunctiontensor_to_mv_list
Transforms a torch.Tensor to a list of multivector objects.
gatr/utils/clifford.py:23
↓ 2 callersMethodupdate
Updates node states with aggregated messages.
gatr/baselines/gcan.py:221
↓ 2 callersMethodvalidate
Runs validation loop, logs results, and may store state dict for early stopping. Parameters ---------- dataloader : torch.uti
gatr/experiments/base_experiment.py:242
↓ 1 callersMethod__init__
(self)
tests_regression/regression_datasets/translation_norm.py:13
↓ 1 callersMethod__init__
(self)
tests_regression/regression_datasets/translate_point.py:13
↓ 1 callersMethod__init__
(self)
tests_regression/regression_datasets/points_distance.py:13
↓ 1 callersMethod__init__
(self)
tests_regression/regression_datasets/connect_points.py:13
↓ 1 callersMethod__init__
(self, net)
gatr/experiments/arteries/wrappers.py:63
↓ 1 callersMethod__init__
(self, config: SelfAttentionConfig)
gatr/layers/attention/qkv.py:20
↓ 1 callersMethod_attend
Scaled dot-product attention.
gatr/baselines/transformer.py:216
↓ 1 callersMethod_attention_block
Attention block.
gatr/layers/gatr_block.py:157
↓ 1 callersMethod_augment_gravity_graph
SEGNN feature engineering for n-body experiments. Constructs node features (position relative to mean position, velocity embedding, absolute
gatr/experiments/nbody/wrappers.py:256
next →1–100 of 452, ranked by callers