Skip to main content

Attention Contact Planning (wip)

Implementation of Humanoid Mobility via Attention-based Contacts (paper), out of ETH Zürich

Install

pip install attention-contact-planning

Usage

The proposed cross attention, where body queries attend over terrain points, with a learned no-contact slot at index 0

import torch
from attention_contact_planning import CrossAttention

cross_attn = CrossAttention(
    dim = 96,
    heads = 32,
    dim_head = 3,
    point_dim = 3
)

body_queries = torch.randn(2, 9, 96)     # b i d
terrain_points = torch.randn(2, 187, 3)  # b j 3
point_mask = torch.ones(2, 187, dtype = torch.bool)

out = cross_attn(
    body_queries,
    terrain_points,
    point_mask = point_mask
)

out.contact_probs # (2, 32, 9, 188), column 0 is no-contact

Train the contact distribution against soft targets straight from the attention logits

from attention_contact_planning import contact_probs_loss

soft_target_probs = torch.randn(2, 9, 187).softmax(dim = -1) # b i j

loss = contact_probs_loss(
    out.attn_logits,
    soft_target_probs,
    point_mask = point_mask
)

Citations

@article{acp2026humanoid,
    title   = {Humanoid Mobility via Attention-based Contacts},
    author  = {He, Junzhe and Wen, Kehan and Zhang, Chong and Schwarke, Clemens and
               Zhang, Zewei and Qu, Kaixian and Hu, Siyuan and M{\"u}ller, Matthias and
               Koltun, Vladlen and Hutter, Marco},
    journal = {arXiv preprint arXiv:2610.31608},
    year    = {2026}
}
@article{shazeer2020talkingheads,
    title   = {Talking-Heads Attention},
    author  = {Shazeer, Noam and Lan, Zhenzhong and Cheng, Youlong and Ding, Nan and Hou, Le},
    journal = {arXiv preprint arXiv:2003.02436},
    year    = {2020}
}
@article{jaegle2021perceiver,
    title   = {Perceiver: General Perception with Iterative Attention},
    author  = {Jaegle, Andrew and Gimeno, Felix and Brock, Andrew and Zisserman, Andrew and
               Vinyals, Oriol and Carreira, Jo{\~a}o},
    journal = {arXiv preprint arXiv:2103.03206},
    year    = {2021}
}

Metadata

Release files for attention-contact-planning 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for attention-contact-planning 0.0.8
File Size Uploaded Provenance Actions
attention_contact_planning-0.0.8.tar.gz 9.4 kB Without provenance Details for attention_contact_planning-0.0.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for attention-contact-planning 0.0.8
File Interpreter ABI Platform Actions
attention_contact_planning-0.0.8-py3-none-any.whl Python 3 none any Details for attention_contact_planning-0.0.8-py3-none-any.whl

Total release size: 18.3 kB

Release files / attention_contact_planning-0.0.8.tar.gz

Download URL attention_contact_planning-0.0.8.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3cf9dc8fa07c924ff5b719e2adec13fd5770cbd317166dd10472fada67a56fbb
BLAKE2b-256 checksum
How to use checksums
def77387e05764b06a88685dbdbed2db66f9610bae68e70e9b27485f98efe5fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.17

Release files / attention_contact_planning-0.0.8-py3-none-any.whl

Download URL attention_contact_planning-0.0.8-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
75769bfb35c5c7f93fa398b8bdb58a7b5e76a8aa0e718dd8f31f9a59da28dcf4
BLAKE2b-256 checksum
How to use checksums
9e85c6a264aedc2e91240b965140eae14d6c2b729ca8dcc88f9f3d42c3ea0971
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.17

Security for attention-contact-planning 0.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page