SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2207.09644 · ECCV · 2022

Hierarchically Self-Supervised Transformer for Human Skeleton Representation Learning

Long Zhao, Dimitris Metaxas, Yuxiao Chen, Ligong Han, Yu Tian, Shijie Geng, Jianbo Yuan, Zhaoyang Xia

arXiv · PDF · Open in the Atlas

Code that ran

9 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (5 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2207.09644.json · badge: /api/ran/2207.09644.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
yuxiaochen1103/Hi-TRS marked official in Papers with Code
Papers with Code archive
9 ran · 1 no recorded run
FunctionStatusWhere it lives
MaskedL2 Ran
ran on a synthesized input
yuxiaochen1103/Hi-TRS/model/Hi_TRS.py
code served (permissive licence) · get_code("15f9d47288a5355f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

INIT_ARGS = {}

ARGS = {
    "pred": torch.randn(2, 4, 3),
    "mask_label": torch.randn(2, 4, 3),
    "mask": torch.tensor([
        [[1], [1], [0], [1]],
        [[0], [1], [1], [0]]
    ], dtype=torch.float32)
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
MultiHeadAttention Ran
ran on a synthesized input · constructed an object; no result was computed
yuxiaochen1103/Hi-TRS/model/Hi_TRS.py
code served (permissive licence) · get_code("c1f7ea6657c382e1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, MultiHeadAttention: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Define the ARGS dictionary with all parameters for MultiHeadAttention
ARGS = {
    'n_head': 2,
    'd_att': 4,
    'd_model': 8,
    'dropout': 0.1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MultiHeadAttention — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MultiHeadAttention output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
PE Ran
ran on a synthesized input · constructed an object; no result was computed
yuxiaochen1103/Hi-TRS/model/Hi_TRS.py
code served (permissive licence) · get_code("35bb07acca050284")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, PE: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import math

torch.manual_seed(0)

# The PE class takes a shape parameter which is either:
# - (d_model, length) for 1D positional encoding
# - (d_model, height, width) for 2D positional encoding

# Test case 1: 1D positional encoding
# shape = (d_model, length)
# d_model must be even for 1D
shape_1d = (4, 3)

# Create a dummy input tensor for 1D case
# The forward method expects x.shape[1:] == pe.shape
# So if pe.shape is (length, d_model), x should be (batch, length, d_model)
x_1d = torch.randn(2, 3, 4)

ARGS = {
    "shape": shape_1d
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PE — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a PE output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
PE_1D Ran
ran, honoured the contract we drafted
yuxiaochen1103/Hi-TRS/model/Hi_TRS.py
code served (permissive licence) · get_code("c12b3cd413f3691b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (4, 8) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import math

torch.manual_seed(0)

ARGS = {
    "d_model": 8,
    "length": 4,
    "parameter": 10000.0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (4, 8) — shape (4, 8) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
PE_2D Ran
ran, honoured the contract we drafted
yuxiaochen1103/Hi-TRS/model/Hi_TRS.py
code served (permissive licence) · get_code("1c250499565b5c52")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 3, dtype family float, shape (4, 3, 8) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import math

torch.manual_seed(0)

ARGS = {
    "d_model": 8,
    "height": 4,
    "width": 3,
    "parameter_1": 10000.0,
    "parameter_2": 10000.0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (4, 3, 8) — shape (4, 3, 8) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
PositionwiseFeedForward Ran
ran on a synthesized input · constructed an object; no result was computed
yuxiaochen1103/Hi-TRS/model/Hi_TRS.py
code served (permissive licence) · get_code("c43b3abbac05b81b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, PositionwiseFeedForward: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# The PositionwiseFeedForward class takes d_in, d_hid, and dropout as parameters
# d_in: input dimension
# d_hid: hidden dimension
# dropout: dropout rate (default 0.1)

ARGS = {
    'd_in': 4,
    'd_hid': 8,
    'dropout': 0.1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PositionwiseFeedForward — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a PositionwiseFeedForward output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
ScaledDotProductAttention Ran
ran on a synthesized input · constructed an object; no result was computed
yuxiaochen1103/Hi-TRS/model/Hi_TRS.py
code served (permissive licence) · get_code("abf8b1833f6b938f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, ScaledDotProductAttention: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

class ScaledDotProductAttention(nn.Module):
    """ Scaled Dot-Product Attention """

    def __init__(self, temperature, attn_dropout=0):
        super(ScaledDotProductAttention, self).__init__()
        self.temperature = temperature
        self.dropout = nn.Dropout(attn_dropout)
        print('attn_drop out:', attn_dropout)

    def forward(self, q, k, v, mask=None):
        attn = torch.matmul(q / self.temperature, k.transpose(2, 3))
        if mask is not None:
            attn = attn.masked_fill(mask == 1, -1000000000.0)
        attn = self.dropout(F.softmax(attn, dim=-1))
        att_ft = torch.matmul(attn, v)
        return (att_ft, attn)


# Construct arguments for __init__
temperature = 8.0
attn_dropout = 0.1

ARGS = {
    'temperature': temperature,
    'attn_dropout': attn_dropout
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ScaledDotProductAttention — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ScaledDotProductAttention output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
TransformerEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
yuxiaochen1103/Hi-TRS/model/Hi_TRS.py
code served (permissive licence) · get_code("afefeff8d7bc6ba3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, TransformerEncoder: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import copy

torch.manual_seed(0)

# Create a minimal encoder layer that satisfies the interface
class MinimalEncoderLayer(nn.Module):
    def __init__(self, d_model=4):
        super(MinimalEncoderLayer, self).__init__()
        self.d_model = d_model
        self.linear = nn.Linear(d_model, d_model)
    
    def forward(self, enc_input, slf_attn_mask=None):
        # Returns (output, attention_weights)
        # enc_input shape: (batch, seq_len, d_model)
        output = self.linear(enc_input)
        # Create dummy attention weights
        batch_size, seq_len, _ = enc_input.shape
        attn_weights = torch.ones(batch_size, seq_len, seq_len)
        return output, attn_weights

# Create the encoder layer instance
encoder_layer = MinimalEncoderLayer(d_model=4)

# Create input tensor: (batch_size=2, seq_len=3, d_model=4)
input_tensor = torch.randn(2, 3, 4)

# Optional mask tensor: (batch_size=2, seq_len=3, seq_len=3)
mask_tensor = torch.ones(2, 3, 3)

ARGS = {
    'encoder_layer': encoder_layer,
    'layer_num': 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type TransformerEncoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TransformerEncoder output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
TransformerEncoderLayer Ran
ran on a synthesized input
yuxiaochen1103/Hi-TRS/model/Hi_TRS.py
code served (permissive licence) · get_code("057b6db36bc7752b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F

class ScaledDotProductAttention(nn.Module):
    """ Scaled Dot-Product Attention """

    def __init__(self, temperature, attn_dropout=0):
        super(ScaledDotProductAttention, self).__init__()
        self.temperature = temperature
        self.dropout = nn.Dropout(attn_dropout)
        print('attn_drop out:', attn_dropout)

    def forward(self, q, k, v, mask=None):
        attn = torch.matmul(q / self.temperature, k.transpose(2, 3))
        if mask is not None:
            attn = attn.masked_fill(mask == 1, -1000000000.0)
        attn = self.dropout(F.softmax(attn, dim=-1))
        att_ft = torch.matmul(attn, v)
        return (att_ft, attn)

class MultiHeadAttention(nn.Module):
    """ Multi-Head Attention module """

    def __init__(self, n_head, d_att, d_model, dropout=0.1):
        super(MultiHeadAttention, self).__init__()
        self.n_head = n_head
        self.d_att = d_att
        self.w_qs = nn.Linear(d_model, n_head * d_att, bias=False)
        self.w_ks = nn.Linear(d_model, n_head * d_att, bias=False)
        self.w_vs = nn.Linear(d_model, n_head * d_att, bias=False)
        self.fc = nn.Linear(n_head * d_att, d_model, bias=False)
        self.attention = ScaledDotProductAttention(temperature=d_att ** 0.5)
        self.dropout = nn.Dropout(dropout, inplace=True)

    def forward(self, q, k, v, mask=None):
        d_att, n_head = (self.d_att, self.n_head)
        sz_b, len_q, len_k, len_v = (q.size(0), q.size(1), k.size(1), v.size(1))
        q = self.w_qs(q).view(sz_b, len_q, n_head, d_att)
        k = self.w_ks(k).view(sz_b, len_k, n_head, d_att)
        v = self.w_vs(v).view(sz_b, len_v, n_head, d_att)
        q, k, v = (q.transpose(1, 2), k.transpose(1, 2), v.transpose(1, 2))
        att_ft, attn = self.attention(q, k, v, mask=mask)
        att_ft = att_ft.transpose(1, 2).contiguous().view(sz_b, len_q, -1)
        att_ft = self.dropout(self.fc(att_ft))
        return (att_ft, attn)

class PositionwiseFeedForward(nn.Module):
    """ A two-feed-forward-layer module """

    def __init__(self, d_in, d_hid, dropout=0.1):
        super(PositionwiseFeedForward, self).__init__()
        self.w_1 = nn.Linear(d_in, d_hid)
        self.w_2 = nn.Linear(d_hid, d_in)
        self.dropout = nn.Dropout(dropout, inplace=True)

    def forward(self, x):
        x = self.w_2(F.gelu(self.w_1(x)))
        x = self.dropout(x)
        return x

class TransformerEncoderLayer(nn.Module):
    """ Compose with two layers """

    def __init__(self, d_model, d_inner, n_head, d_att, dropout):
        super(TransformerEncoderLayer, self).__init__()
        self.self_attn_norm = nn.LayerNorm(d_model)
        self.slf_attn = MultiHeadAttention(n_head=n_head, d_att=d_att, d_model=d_model, dropout=dropout)
        self.pff_norm = nn.LayerNorm(d_model)
        self.pos_ffn = PositionwiseFeedForward(d_in=d_model, d_hid=d_inner, dropout=dropout)

    def forward(self, enc_input, slf_attn_mask=None):
        residual = enc_input
        enc_input = self.self_attn_norm(enc_input)
        enc_output, enc_slf_attn = self.slf_attn(q=enc_input, k=enc_input, v=enc_input, mask=slf_attn_mask)
        enc_output = residual + enc_output
        residual = enc_output
        enc_output = self.pff_norm(enc_output)
        enc_output = self.pos_ffn(enc_output)
        enc_output = enc_output + residual
        return (enc_output, enc_slf_attn)

INIT_ARGS = {
    'd_model': 8,
    'd_inner': 16,
    'n_head': 2,
    'd_att': 4,
    'dropout': 0.1
}

ARGS = {
    'enc_input': torch.randn(2, 3, 8),
    'slf_attn_mask': None
}

if __name__ == '__main__':
    model = TransformerEncoderLayer(**INIT_ARGS)
    output, attn = model(**ARGS)
    print("Output shape:", output.shape)
    print("Attention shape:", attn.shape)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
Hi_TRS Not yet run
unverified (harvested, no recorded run)
yuxiaochen1103/Hi-TRS/model/Hi_TRS.py
code served (permissive licence) · get_code("b91b8571cad846af")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 10 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Despite the success of fully-supervised human skeleton sequence modeling, utilizing self-supervised pre-training for skeleton sequence representation learning has been an active field because acquiring task-specific skeleton annotations at large scales is difficult. Recent studies focus on learning video-level temporal and discriminative information using contrastive learning, but overlook the hierarchical spatial-temporal nature of human skeletons. Different from such superficial supervision at the video level, we propose a self-supervised hierarchical pre-training scheme incorporated into a hierarchical Transformer-based skeleton sequence encoder (Hi-TRS), to explicitly capture spatial, short-term, and long-term temporal dependencies at frame, clip, and video levels, respectively. To evaluate the proposed self-supervised pre-training scheme with Hi-TRS, we conduct extensive experiments covering three skeletonbased downstream tasks including action recognition, action detection, and motion prediction. Under both supervised and semi-supervised evaluation protocols, our method achieves the state-of-the-art performance. Additionally, we demonstrate that the prior knowledge learned by our model in the pre-training stage has strong transfer capability for different downstream tasks. The source code can be found at https://github. com/yuxiaochen1103/Hi-TRS.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2207.09644")
get_code_for_paper("2207.09644")
have("2207.09644")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2207.09644.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2207.09644.svg)](https://syntology.ai/paper/2207.09644)

Connect an agent — have() is free.