Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Qualcomm-AI-research/geometric-algebra-transformer
/ functions
Functions
452 in github.com/Qualcomm-AI-research/geometric-algebra-transformer
⨍
Functions
452
◇
Types & classes
61
↳
Endpoints
4
↓ 1 callers
Function
_build_dist_basis
Compute basis features for queries and keys in the geometric SDP attention. Parameters ---------- device: torch.device Device.
gatr/primitives/attention.py:206
↓ 1 callers
Method
_build_graph
Builds graph for a single sample.
gatr/experiments/nbody/wrappers.py:375
↓ 1 callers
Method
_build_graphs
Builds graph for a full batch.
gatr/experiments/nbody/wrappers.py:366
↓ 1 callers
Method
_compute_accelerations
Computes accelerations for a set of point masses according to Newtonian gravity.
gatr/experiments/nbody/simulator.py:207
↓ 1 callers
Function
_compute_dualization
Constructs a tensor for the dual operation. Parameters ---------- device : torch.device Device dtype : torch.dtype Dt
gatr/primitives/dual.py:18
↓ 1 callers
Method
_compute_embeddings
Computes position embeddings and stores them. The position embedding is computed along dimension `item_dim` of tensor `inputs` and is
gatr/layers/attention/positional_encoding.py:92
↓ 1 callers
Function
_compute_grade_involution
Constructs a matrix that computes multivector grade involution. Parameters ---------- device : torch.device Device dtype : to
gatr/primitives/linear.py:88
↓ 1 callers
Method
_compute_init_factors
Computes prefactors for the initialization. See self.reset_parameters().
gatr/layers/linear.py:234
↓ 1 callers
Function
_compute_join_norm_idx
Constructs everything we need to compute norm(equi_norm(x,y)) in a memory-efficient way. Parameters ---------- threshold : float
gatr/primitives/dual.py:83
↓ 1 callers
Method
_construct_reinserted_channels
Constructs input features that will be reinserted in every attention layer.
gatr/nets/gatr.py:213
↓ 1 callers
Method
_create_model
Creates the model from the config. Returns ------- model : torch.nn.Module A randomly initialized model, followin
gatr/experiments/base_experiment.py:505
↓ 1 callers
Method
_create_optimizer_and_scheduler
Creates optimizer and scheduler. Returns ------- optim : torch.optim.Optimizer Adam optimizer for the parameters
gatr/experiments/base_experiment.py:517
↓ 1 callers
Function
_einsum_with_path
Computes einsum with a given contraction path.
gatr/utils/einsum.py:12
↓ 1 callers
Method
_fully_connected_idx
Creates source and destination indices for a fully connected graph.
gatr/experiments/nbody/wrappers.py:388
↓ 1 callers
Function
_get_cached_path_for_equation_and_shapes
Provides shape-based caching of the optimal contraction path.
gatr/utils/einsum.py:43
↓ 1 callers
Method
_init_backend
Initializes device, dtype, and attention implementation.
gatr/experiments/base_experiment.py:349
↓ 1 callers
Method
_init_multivectors
Weight initialization for maps to multivector outputs.
gatr/layers/linear.py:283
↓ 1 callers
Method
_init_plt
Initializes matplotlib's rcparams to look good.
gatr/experiments/base_experiment.py:486
↓ 1 callers
Method
_init_scalars
Weight initialization for maps to multivector outputs.
gatr/layers/linear.py:333
↓ 1 callers
Method
_initialize_experiment
Initialize experiment folder (and plenty of other initialization thingies).
gatr/experiments/base_experiment.py:377
↓ 1 callers
Method
_initialize_experiment_folder
Creates experiment folder.
gatr/experiments/base_experiment.py:403
↓ 1 callers
Method
_initialize_mlflow
Initializes all things related to MLflow tracking.
gatr/experiments/base_experiment.py:448
↓ 1 callers
Method
_load_data
Loads data from file and converts to input and output tensors.
gatr/experiments/nbody/dataset.py:39
↓ 1 callers
Method
_log
Log to MLflow. Parameters ---------- loss : torch.Tensor Loss metrics : dict with str keys and float valu
gatr/experiments/base_experiment.py:701
↓ 1 callers
Method
_make_net
PGA-MLP code as sent by David Ruhe.
gatr/baselines/gcan.py:95
↓ 1 callers
Method
_mlp_block
MLP block.
gatr/layers/gatr_block.py:177
↓ 1 callers
Method
_move_files
Use rope to move files.
docker/ext_packages/install_upstream_python_packages.py:141
↓ 1 callers
Method
_optimizer_step
Optimizer step and gradient norm clipping.
gatr/experiments/base_experiment.py:627
↓ 1 callers
Method
_post_step
(self, loss, metrics, grad_norm, step, val_data, val_loader)
gatr/experiments/base_experiment.py:593
↓ 1 callers
Method
_prep_data
Data preparation during training loop, e.g. to move data to correct device and dtype.
gatr/experiments/arteries/experiment.py:105
↓ 1 callers
Method
_reshape_data_after_even_blocks
(self, h, input_batch_dims)
gatr/baselines/transformer.py:552
↓ 1 callers
Method
_reshape_data_after_even_blocks
(self, multivector, scalar, input_batch_dims)
gatr/nets/axial_gatr.py:245
↓ 1 callers
Method
_reshape_data_after_odd_blocks
(self, h, input_batch_dims)
gatr/baselines/transformer.py:532
↓ 1 callers
Method
_reshape_data_after_odd_blocks
(self, multivector, scalar, input_batch_dims)
gatr/nets/axial_gatr.py:219
↓ 1 callers
Method
_reshape_data_before_even_blocks
(self, h)
gatr/baselines/transformer.py:542
↓ 1 callers
Method
_reshape_data_before_even_blocks
(self, multivector, scalar)
gatr/nets/axial_gatr.py:233
↓ 1 callers
Method
_reshape_data_before_odd_blocks
(self, h)
gatr/baselines/transformer.py:519
↓ 1 callers
Method
_reshape_data_before_odd_blocks
(self, multivector, scalar)
gatr/nets/axial_gatr.py:203
↓ 1 callers
Method
_rotate_half
Utility function that "rotates" a tensor, as required for rotary embeddings.
gatr/layers/attention/positional_encoding.py:126
↓ 1 callers
Method
_sample_planet_velocities
Samples planet velocities around those that give stable circular orbits.
gatr/experiments/nbody/simulator.py:143
↓ 1 callers
Method
_save_config
Stores the config in the experiment folder and tracks it with mlflow.
gatr/experiments/base_experiment.py:492
↓ 1 callers
Function
_sdpa_graph_breaking
A helper function to isolate the graph-breaking parts of the attention (cf. decorator). TODO: This function can be dissolved once we get expand_p
gatr/primitives/attention.py:421
↓ 1 callers
Method
_shift_and_rotate
Performs random E(3) transformations and permutations on given positions / velocities.
gatr/experiments/nbody/simulator.py:164
↓ 1 callers
Method
_simulate
Evolves an initial state under Newtonian equations of motions.
gatr/experiments/nbody/simulator.py:192
↓ 1 callers
Method
_sort_files_by_priority
Sorts files for priority refactoring. This is necessary as else rope will get this wrong in some cases: It can, for example, make a d
docker/ext_packages/install_upstream_python_packages.py:163
↓ 1 callers
Method
_step
Everything that may happen per step.
gatr/experiments/base_experiment.py:573
↓ 1 callers
Method
add_init_files
Adds an `__init__.py` file for ever subfolder of checkout path (if missing).
docker/ext_packages/install_upstream_python_packages.py:112
↓ 1 callers
Method
add_new_pyproject_file
Adds a generic `pyproject.toml` file to the project root.
docker/ext_packages/install_upstream_python_packages.py:128
↓ 1 callers
Method
apply_patches
Applies patch from a patch file, if provided upon instantiation.
docker/ext_packages/install_upstream_python_packages.py:107
↓ 1 callers
Function
block_stack
Block diagonally stack tensors along dimensions dim1 and dim2.
gatr/utils/tensors.py:30
↓ 1 callers
Method
build_attention_mask
Construct attention mask. Parameters ---------- inputs : torch.Tensor Raw inputs to wrapped network. mv :
gatr/experiments/base_wrapper.py:29
↓ 1 callers
Function
check_consistence_with_dual
Checks whether a callable computes the reversal of a multivector.
tests/helpers/geometric_algebra.py:98
↓ 1 callers
Function
check_consistence_with_geometric_product
Checks whether a callable computes the geometric product.
tests/helpers/geometric_algebra.py:22
↓ 1 callers
Function
check_consistence_with_grade_involution
Checks whether a callable computes the grade involution of a multivectors.
tests/helpers/geometric_algebra.py:80
↓ 1 callers
Function
check_consistence_with_outer_product
Checks whether a callable computes the outer product.
tests/helpers/geometric_algebra.py:42
↓ 1 callers
Function
check_consistence_with_reversal
Checks whether a callable computes the reversal of a multivector.
tests/helpers/geometric_algebra.py:62
↓ 1 callers
Method
checkout_commit
Checks out the commit hash provided upon instantiation.
docker/ext_packages/install_upstream_python_packages.py:102
↓ 1 callers
Method
clone_from_upstream
Clones the git repository from the clone URL provided upon instantiation.
docker/ext_packages/install_upstream_python_packages.py:97
↓ 1 callers
Function
compute_inner_product_mask
Constructs a bool array for the inner product calculation. The inner product of MVs is <~x y>_0, i.e. take the grade-0 component of the geometric
gatr/primitives/invariants.py:14
↓ 1 callers
Function
count_nominal_flops_in_equi_linear
Computes the nominal FLOPs per token for an EquiLinear layer. We assume: - the number of tokens are large, so the token-independent contract
gatr/layers/linear.py:368
↓ 1 callers
Function
embed_3d_object
Embeds the pose of a 3D object PGA multivectors. The pose is given by a position and a orientation quaternion. The latter is assumed to follow
gatr/interface/object.py:15
↓ 1 callers
Function
embed_3d_object_two_vec
Embeds the pose of a 3D object in two-vec parameterization into the PGA. The inputs consist of the position of an object and two vectors that spe
gatr/interface/object.py:146
↓ 1 callers
Method
embed_into_ga
Embeds raw inputs into the geometric algebra (+ scalar) representation. To be implemented by subclasses. Parameters --------
tests_regression/regression_datasets/connect_points.py:47
↓ 1 callers
Method
embed_into_ga
Embeds raw inputs into the geometric algebra (+ scalar) representation. To be implemented by subclasses. Parameters --------
gatr/experiments/base_wrapper.py:85
↓ 1 callers
Method
evaluate
Evaluates self.model on all eval datasets and logs the results.
gatr/experiments/base_experiment.py:276
↓ 1 callers
Function
extract_3d_object
Extracts 3D position and quaternion orientation from the multivector embedding of an object. This function inverts embed_3d_object(). The ex
gatr/interface/object.py:79
↓ 1 callers
Function
extract_3d_object_two_vec
Extracts 3D position and two-vec orientation from the multivector embedding of an object. This inverts embed_3d_object_two_vec(). Parameters
gatr/interface/object.py:187
↓ 1 callers
Method
extract_from_ga
Embeds raw inputs into the geometric algebra (+ scalar) representation. To be implemented by subclasses. Parameters --------
tests_regression/regression_datasets/connect_points.py:81
↓ 1 callers
Method
extract_from_ga
Extracts raw outputs from the GATr multivector + scalar outputs. To be implemented by subclasses. Parameters ----------
gatr/experiments/base_wrapper.py:104
↓ 1 callers
Method
extract_from_ga
Extracts predicted positions from PGA multivectors.
gatr/experiments/nbody/wrappers.py:450
↓ 1 callers
Function
extract_pluecker_ray
Extract ray in Plücker coordinates from a multivector. Plücker coords are (v, o x v) for ray through o in direction v. Args: multive
gatr/interface/ray.py:28
↓ 1 callers
Function
extract_reflection
Extracts the normal on an reflection plane from a multivector. References ---------- Leo Dorst, "A Guided Tour to the Plane-Based Geometr
gatr/interface/reflection.py:37
↓ 1 callers
Function
extract_translation
DEPRECATED: Given a multivector, extract 3D translation vector from the bivector components. Note bene: this function is NOT equivariant, unless
gatr/interface/translation.py:52
↓ 1 callers
Function
flatten_dict
Flattens a nested dictionary with str keys.
gatr/utils/misc.py:63
↓ 1 callers
Function
gated_gelu
Pin-equivariant gated GeLU nonlinearity without division. Given multivector input x and scalar input gates (with matching batch dimensions), comp
gatr/primitives/nonlinearities.py:58
↓ 1 callers
Function
gated_gelu_divide
Pin-equivariant gated GeLU nonlinearity with division. Given multivector input x and scalar input gates (with matching batch dimensions), compute
gatr/primitives/nonlinearities.py:86
↓ 1 callers
Function
gatr_einsum_with_path
Computes einsum with a given contraction path (which is ignored when using compilation). Cf. `enable_cached_einsum` for more context.
gatr/utils/einsum.py:82
↓ 1 callers
Function
generate_datasets
Generates a canonical set of datasets for the n-body problem, stores them in `path`.
scripts/generate_nbody_dataset.py:29
↓ 1 callers
Function
get_batchsize
Given either a tensor or a list of tensors or a dict of tensors, returns the batchsize.
gatr/utils/misc.py:138
↓ 1 callers
Function
get_packages
Gets list of all Python packages to install.
docker/ext_packages/install_upstream_python_packages.py:232
↓ 1 callers
Function
get_parity
Gets parity of a clifford multivector. Given a clifford multivector, returns True if it is pure-odd-grade, False if it is pure-even grade, an
gatr/utils/clifford.py:72
↓ 1 callers
Function
get_version
Extracts version information. Inspired by item "1." @ https://packaging.python.org/guides/single-sourcing-package-version/.
setup.py:26
↓ 1 callers
Method
install_package
Performs all steps necessary up to and including installation of the package.
docker/ext_packages/install_upstream_python_packages.py:75
↓ 1 callers
Function
install_packages
Refactors flat Python projects into installable form.
docker/ext_packages/install_upstream_python_packages.py:224
↓ 1 callers
Function
linear
EquiLinear fixture for testing
tests/gatr/layers/test_gatr_block.py:31
↓ 1 callers
Method
load_model
Loads a model checkpoint from disk. Parameters ---------- checkpoint : None or str or pathlib.Path Path to checkp
gatr/experiments/base_experiment.py:139
↓ 1 callers
Function
main
Entry point for artery experiment.
scripts/artery_experiment.py:11
↓ 1 callers
Function
main
Entry point for n-body experiment.
scripts/nbody_experiment.py:11
↓ 1 callers
Function
main
Entry point for n-body dataset generation.
scripts/generate_nbody_dataset.py:51
↓ 1 callers
Method
make_edge_index
Constructs an edge index for fully connected graph.
gatr/experiments/nbody/wrappers.py:464
↓ 1 callers
Function
make_full_edge_index
Creates a PyG-style edge index for a fully connected graph of `num_nodes` nodes.
gatr/utils/misc.py:115
↓ 1 callers
Function
minimum_dtype
Return dtype with maximum precision. Compatible with compilation.
gatr/utils/misc.py:162
↓ 1 callers
Method
move_to_project_folder
Moves Python files and folders into folder with the project's name, adapts imports.
docker/ext_packages/install_upstream_python_packages.py:133
↓ 1 callers
Method
move_to_src_folder
Moves package code to `src` folder. That is, we move the code from `<checkout_base_dir> / project-name / project-name` to `<checkout
docker/ext_packages/install_upstream_python_packages.py:179
↓ 1 callers
Method
pip_install_refactored_package
Installs the refactored package using `pip`.
docker/ext_packages/install_upstream_python_packages.py:191
↓ 1 callers
Method
remove_packaging_files
Removes all packaging files.
docker/ext_packages/install_upstream_python_packages.py:122
↓ 1 callers
Method
reset_parameters
Initializes the weights of the layer. Parameters ---------- initialization : {"default", "small", "unit_scalar", "almost_unit
gatr/layers/linear.py:177
↓ 1 callers
Function
resursively_move_gcan_pga
Moves all PGA instances in GCAN component to device / dtype.
gatr/experiments/nbody/wrappers.py:479
↓ 1 callers
Method
sample
Samples from gravity problem. Parameters ---------- num_samples : int Number of samples. num_planets : in
gatr/experiments/nbody/simulator.py:76
↓ 1 callers
Function
sample_pin_multivector
Samples from the Pin(3,0,1) group as a product of reflections.
gatr/utils/clifford.py:42
← previous
next →
101–200 of 452, ranked by callers