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.10

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.10
File Size Uploaded Provenance Actions
attention_contact_planning-0.0.10.tar.gz 10.3 kB Without provenance Details for attention_contact_planning-0.0.10.tar.gz

Built distribution (wheel)

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

Total release size: 20.3 kB

Release files / attention_contact_planning-0.0.10.tar.gz

Download URL attention_contact_planning-0.0.10.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
dde3b6aa326eac216a91038b93bcc4f9619f4c71aad3b6afcea54330b5ee2ef6
BLAKE2b-256 checksum
How to use checksums
baefdaa545af088a2ee4ba903ffd5ed50622c1bd3a6de49324edbb6917497349
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.17

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

Download URL attention_contact_planning-0.0.10-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
84170cfcc8f5a0fad36c5e1a96d830486e0045a61cd452dbb78fc9b9954f0a8b
BLAKE2b-256 checksum
How to use checksums
e502362613f36f3f37b80d78f1883fa554a230898c63f856c6eb4f344ff76ce7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.17

Security for attention-contact-planning 0.0.10

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