SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2511.21848 · NeurIPS · 2025

Massively Parallel Imitation Learning of Mouse Forelimb Musculoskeletal Reaching Dynamics

Eric Leonardis, Akira Nagamori, Ayesha Thanawalla, Yuanjia Yang, Joshua Park, Hutton Saunders, Eiman Azim, Talmo Pereira

arXiv · PDF · Open in the Atlas

Code that ran

8 of 13 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 7 failures of our instrument; 5 no recorded run), measured 2026-11-23; 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/2511.21848.json · badge: /api/ran/2511.21848.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
talmolab/track-mjx canonical (classifier label)
classifier basis: census
7 ran · 5 no recorded run
talmolab/stac-mjx canonical (classifier label)
classifier basis: census
1 ran · 0 no recorded run
FunctionStatusWhere it lives
compute_ar1_temporal_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
talmolab/track-mjx/track_mjx/agent/ff_ppo/losses.py
code served (permissive licence) · get_code("895dcb81090d9b75")
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 ArrayImpl, ndim 0, dtype family float, shape () 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 jax.numpy as jnp
import numpy as np

# Set seed for reproducibility
np.random.seed(0)

# Define small tensor dimensions
T = 5  # time steps
B = 2  # batch size
D = 4  # latent dimension

# Create latent_mean: shape [T, B, D]
latent_mean = jnp.array(np.random.randn(T, B, D), dtype=jnp.float32)

# Create discount: shape [T, B]
# Values should be 0 (episode end) or 1 (episode continues)
discount = jnp.array(np.array([
    [1.0, 1.0],
    [1.0, 1.0],
    [0.0, 1.0],  # First sequence ends here
    [1.0, 1.0],
    [1.0, 0.0],
], dtype=np.float32))

# Create truncation: shape [T, B]
# Values should be 0 (terminated) or 1 (truncated)
truncation = jnp.array(np.array([
    [0.0, 0.0],
    [0.0, 1.0],  # Second sequence truncated
    [0.0, 0.0],
    [1.0, 0.0],
    [0.0, 0.0],
], dtype=np.float32))

ARGS = {
    "latent_mean": latent_mean,
    "discount": discount,
    "truncation": truncation,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 0, dtype family float, shape () — shape () 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
compute_gae Ran
ran; our contract draft was wrong, not the code
talmolab/track-mjx/track_mjx/agent/ff_ppo/losses.py
code served (permissive licence) · get_code("edd567b15d0b6be9")
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 tuple, ndim 3, dtype family float; no output shape is stated. The image it ran in was 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 jax
import jax.numpy as jnp

# Set random seed for reproducibility
jax.config.update('jax_platform_name', 'cpu')

# Define dimensions
T = 5  # Time steps
B = 2  # Batch size

# Create small test tensors
truncation = jnp.array([[0.0, 1.0],
                        [0.0, 0.0],
                        [1.0, 0.0],
                        [0.0, 1.0],
                        [0.0, 0.0]], dtype=jnp.float32)  # [T, B]

termination = jnp.array([[0.0, 0.0],
                         [0.0, 1.0],
                         [0.0, 0.0],
                         [1.0, 0.0],
                         [0.0, 0.0]], dtype=jnp.float32)  # [T, B]

rewards = jnp.array([[1.0, 2.0],
                     [1.5, 0.5],
                     [2.0, 1.0],
                     [0.5, 1.5],
                     [1.0, 2.0]], dtype=jnp.float32)  # [T, B]

values = jnp.array([[0.5, 0.6],
                    [0.7, 0.4],
                    [0.8, 0.5],
                    [0.6, 0.7],
                    [0.5, 0.8]], dtype=jnp.float32)  # [T, B]

bootstrap_value = jnp.array([0.9, 0.85], dtype=jnp.float32)  # [B]

lambda_ = 0.95

discount = 0.99

ARGS = {
    'truncation': truncation,
    'termination': termination,
    'rewards': rewards,
    'values': values,
    'bootstrap_value': bootstrap_value,
    'lambda_': lambda_,
    'discount': discount
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, dtype family float — a tuple output has no array shape of its own; none is stated
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
compute_kl_to_gaussian_prior Ran
ran, violated the contract we drafted
talmolab/track-mjx/track_mjx/agent/ff_ppo/losses.py
code served (permissive licence) · get_code("9155dfc5fd200b7e")
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 ArrayImpl, ndim 0, dtype family float, shape () 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 jax.numpy as jnp

# Set random seed for reproducibility
import jax
jax.config.update("jax_platform_name", "cpu")

# Create small sample tensors with distinct shapes
# T=5 (time/sequence dimension), B=2 (batch), D=4 (latent dimension)
T = 5
B = 2
D = 4

latent_mean = jnp.ones((T, B, D)) * 0.5
latent_logvar = jnp.ones((T, B, D)) * -1.0

ARGS = {
    "latent_mean": latent_mean,
    "latent_logvar": latent_logvar,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 0, dtype family float, shape () — shape () 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
create_decoder_mask Ran
ran; our contract draft was wrong, not the code
talmolab/track-mjx/track_mjx/agent/network_masks.py
code served (permissive licence) · get_code("58801d84288c092d")
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 PPONetworkParams. 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 copy
from typing import Any, NamedTuple

torch_available = True
try:
    import torch
except ImportError:
    torch_available = False


class PPONetworkParams(NamedTuple):
    policy: dict
    value: dict


def create_decoder_mask(params: Any, decoder_name: str='decoder') -> Any:
    """Create a parameter mask that freezes only the decoder.

    Creates a boolean mask with the same structure as the input parameters,
    where True indicates a frozen parameter and False indicates a trainable
    parameter. This is useful for two-phase training where you first train
    the full network, then freeze the decoder to fine-tune only the encoder.

    Args:
        params: PPO network parameters with .policy["params"] and .value
            attributes. Typically a PPONetworkParams namedtuple.
        decoder_name: Key name of the decoder in policy params. Defaults to
            "decoder".

    Returns:
        A deep copy of params with values replaced by boolean masks:
            - policy.params[decoder_name]: True (frozen)
            - policy.params[other keys]: False (trainable)
            - value[all keys]: False (trainable)

    Example:
        >>> mask = create_decoder_mask(ppo_params)
        >>> # Use with optax.multi_transform to apply different optimizers
        >>> optimizer = optax.multi_transform(
        ...     {"frozen": optax.set_to_zero(), "trainable": optax.adam(1e-4)},
        ...     param_labels=mask,
        ... )
    """
    param_mask = copy.deepcopy(params)
    for key in param_mask.policy['params']:
        param_mask.policy['params'][key] = key == decoder_name
    for key in param_mask.value:
        param_mask.value[key] = False
    return param_mask


ppo_params = PPONetworkParams(
    policy={
        'params': {
            'decoder': {'w': 1.0, 'b': 2.0},
            'encoder': {'w': 3.0, 'b': 4.0},
            'attention': {'w': 5.0}
        }
    },
    value={
        'dense1': {'w': 6.0},
        'dense2': {'b': 7.0}
    }
)

ARGS = {
    'params': ppo_params,
    'decoder_name': 'decoder'
}
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 PPONetworkParams — a PPONetworkParams output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PPONetworkParams output the recorded ndim 1 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
gradient_update_fn Ran
ran; our contract draft was wrong, not the code
talmolab/track-mjx/track_mjx/agent/gradients.py
code served (permissive licence) · get_code("8c8a718ae60feb40")
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 function. 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 jax
import jax.numpy as jnp
import optax
from collections.abc import Callable

# Define a simple loss function
def simple_loss_fn(params, x, y):
    """Simple MSE loss function"""
    pred = params * x
    return jnp.mean((pred - y) ** 2)

# Define a loss function with auxiliary outputs
def loss_fn_with_aux(params, x, y):
    """Loss function that returns (loss, aux_dict)"""
    pred = params * x
    loss = jnp.mean((pred - y) ** 2)
    aux = {'prediction_mean': jnp.mean(pred), 'target_mean': jnp.mean(y)}
    return (loss, aux)

# Set up JAX random keys and data
key = jax.random.PRNGKey(0)
x = jax.random.normal(key, (2, 4))
y = jax.random.normal(jax.random.PRNGKey(1), (2, 4))

# Initialize parameters - a simple pytree (array)
params = jnp.ones((4,))

# Create optimizer
optimizer = optax.adam(learning_rate=0.001)
optimizer_state = optimizer.init(params)

# Build the ARGS dict
ARGS = {
    'loss_fn': loss_fn_with_aux,
    'optimizer': optimizer,
    'pmap_axis_name': None,
    'has_aux': True,
    'clip_threshold': 1.0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, optax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
load_dannce Ran
ran; our contract draft was wrong, not the code
talmolab/stac-mjx/stac_mjx/io.py
code served (permissive licence) · get_code("18dd0a67784882c8")
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 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 numpy as np
import scipy.io as spio
from pathlib import Path
import tempfile
import os

# Create temporary .mat files for testing
temp_dir = tempfile.mkdtemp()

# Create a mock .mat file with 'pred' data
# Shape: [frames=10, keypoints=5, xyz=3]
pred_data = np.random.rand(10, 5, 3)
spio.savemat(os.path.join(temp_dir, 'test_dannce.mat'), {'pred': pred_data})

# Create a mock .mat file with joint names
joint_names = np.array([['joint_0'], ['joint_1'], ['joint_2'], ['joint_3'], ['joint_4']])
spio.savemat(os.path.join(temp_dir, 'joint_names.mat'), {'joint_names': joint_names})

filename = os.path.join(temp_dir, 'test_dannce.mat')
names_filename = os.path.join(temp_dir, 'joint_names.mat')

ARGS = {
    'filename': filename,
    'names_filename': names_filename,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — 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: none by the harness; any seed is in the setup block
loss_and_pgrad Ran
ran; our contract draft was wrong, not the code
talmolab/track-mjx/track_mjx/agent/gradients.py
code served (permissive licence) · get_code("bc799a4b1ee0ca16")
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 function. 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 jax
import jax.numpy as jnp

# Define a simple loss function that takes parameters and data
def simple_loss_fn(params, x, y):
    """Simple quadratic loss function."""
    pred = jnp.sum(params * x)
    loss = jnp.mean((pred - y) ** 2)
    return loss

# Define a loss function with auxiliary outputs
def loss_fn_with_aux(params, x, y):
    """Loss function that returns (loss, aux) tuple."""
    pred = jnp.sum(params * x)
    loss = jnp.mean((pred - y) ** 2)
    aux = {"pred": pred, "mse": loss}
    return loss, aux

# Create small test data
params = jnp.array([1.0, 2.0, 3.0, 4.0])
x = jnp.array([0.5, 1.5, 2.5, 3.5])
y = jnp.array([5.0])

ARGS = {
    "loss_fn": simple_loss_fn,
    "pmap_axis_name": None,
    "has_aux": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
require_obs_sizes Ran
ran; our contract draft was wrong, not the code
talmolab/track-mjx/track_mjx/agent/checkpointing.py
code served (permissive licence) · get_code("84b735c81ad116d2")
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 dict. 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 logging

# Test case 1: network_config as dict with obs_sizes containing task_obs and proprioception
network_config_dict_modern = {
    'obs_sizes': {
        'task_obs': 10,
        'proprioception': 5
    }
}

# Test case 2: network_config as dict with legacy imitation_target format
network_config_dict_legacy = {
    'obs_sizes': {
        'imitation_target': 10,
        'proprioception': 5
    }
}

# Test case 3: network_config as object with obs_sizes attribute
class NetworkConfig:
    def __init__(self, obs_sizes):
        self.obs_sizes = obs_sizes

network_config_obj_modern = NetworkConfig({
    'task_obs': 10,
    'proprioception': 5
})

network_config_obj_legacy = NetworkConfig({
    'imitation_target': 10,
    'proprioception': 5
})

# Use the modern dict format as the primary test case
ARGS = {
    'network_config': network_config_dict_modern
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
is_batched_prng_key Not yet run
unverified (harvested, no recorded run)
talmolab/track-mjx/track_mjx/random_utils.py
code served (permissive licence) · get_code("094b38a8ca4d0bf7")
How it ran

no invocation recorded.

load_config_from_checkpoint Not yet run
unverified (harvested, no recorded run)
talmolab/track-mjx/track_mjx/agent/checkpointing.py
code served (permissive licence) · get_code("54f1e0acad4d19d0")
How it ran

no invocation recorded.

load_training_state Not yet run
unverified (harvested, no recorded run)
talmolab/track-mjx/track_mjx/agent/checkpointing.py
code served (permissive licence) · get_code("0c56d39e470c0280")
How it ran

no invocation recorded.

sample_normal Not yet run
unverified (harvested, no recorded run)
talmolab/track-mjx/track_mjx/random_utils.py
code served (permissive licence) · get_code("524f92f4d7f29dd0")
How it ran

no invocation recorded.

split_prng_key Not yet run
unverified (harvested, no recorded run)
talmolab/track-mjx/track_mjx/random_utils.py
code served (permissive licence) · get_code("483863f6c2ff4735")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 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 13 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-23.

Repositories linked to this paper

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

Abstract

The brain has evolved to effectively control the body, and in order to understand the relationship we need to model the sensorimotor transformations underlying embodied control. As part of a coordinated effort, we are developing a general-purpose platform for data-driven simulation modeling high fidelity behavioral dynamics, biomechanics, and neural circuit architectures underlying embodied control. We present a pipeline for taking kinematics data from the neuroscience lab and creating a pipeline for recapitulating those natural movements in physics simulation. We implement an imitation learning framework to simulate a dexterous forelimb reaching task with a musculoskeletal model in the Mujoco physics environment. The imitation learning model is currently training at more than 1 million training steps per second due to GPU acceleration with JAX and Mujoco-MJX. We present results that indicate that adding naturalistic constraints on control magnitude lead to simulated muscle activity that better predicts real EMG signals. This work provides evidence to suggest that control constraints are critical to modeling biological movement control.

For agents

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

get_harvested_code_for_paper("2511.21848")
get_code_for_paper("2511.21848")
have("2511.21848")

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

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

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

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

Connect an agent — have() is free.