Implementation of Rigidformer
Project description
Rigidformer (wip)
Implementation of RigidFormer, Learning Rigid Dynamics using Transformers, out of MIT and Meta
Install
$ pip install rigidformer
Usage
import torch
from rigidformer import Rigidformer, RigidformerRolloutWrapper
# instantiate model
model = Rigidformer(
dim = 256,
dim_head = 192,
heads = 8,
object_self_attn_depth = 4,
anchor_cross_attn_depth = 4,
num_anchors = 4,
object_hidden_layers = (0, 1, 2, 4),
vertex_properties_dim = 3
)
# mock inputs
delta_times = torch.randn(2)
vertex_properties = torch.randn(2, 4, 3) # (batch, num_objects, d_attr)
object_pos = torch.randn(2, 4, 64, 3) # (batch, num_objects, num_points, 3)
object_pos_prev = torch.randn(2, 4, 64, 3)
object_pos_next = torch.randn(2, 4, 64, 3)
# training
loss, loss_breakdown = model(
delta_times = delta_times,
vertex_properties = vertex_properties,
object_pos = object_pos,
object_pos_prev = object_pos_prev,
object_pos_next = object_pos_next
)
loss.backward()
# inference (rollout)
wrapper = RigidformerRolloutWrapper(model)
rollout_positions = wrapper(
delta_times = delta_times,
vertex_properties = vertex_properties,
object_positions = [object_pos_prev, object_pos],
num_steps = 10
)
# rollout_positions is a list of length 12 tensors of shape (batch, num_objects, num_points, 3)
# includes the 2 initial mock positions
Citations
@misc{dou2026rigidformerlearningrigiddynamics,
title = {RigidFormer: Learning Rigid Dynamics using Transformers},
author = {Zhiyang Dou and Minghao Guo and Haixu Wu and Doug Roble and Tuur Stuyck and Wojciech Matusik},
year = {2026},
eprint = {2605.09196},
archivePrefix = {arXiv},
primaryClass = {cs.CV},
url = {https://arxiv.org/abs/2605.09196},
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rigidformer-0.0.24.tar.gz
(11.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rigidformer-0.0.24.tar.gz.
File metadata
- Download URL: rigidformer-0.0.24.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96c88e2080dc9ae8078f604be77dca21ecafb49563b7f01551479bb1c7a84714
|
|
| MD5 |
ba40f9e83597e100a129d44da6950a88
|
|
| BLAKE2b-256 |
4de6afb6a0080cdc28cbde783dd58c0284ea8d39fcc1f174f8ea2085b2227233
|
File details
Details for the file rigidformer-0.0.24-py3-none-any.whl.
File metadata
- Download URL: rigidformer-0.0.24-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f62bf7ca51a6db55fbaffc61d228e4d4e84514233ef77b2e86a467772138a326
|
|
| MD5 |
1c79fa872b7d63c087198d3ee094c66f
|
|
| BLAKE2b-256 |
750228f0928e3186b5fe68fd0f210969dd455c651c6b955e5575f78f64cca484
|