SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.10778 · ICLR · 2023

Deep Declarative Dynamic Time Warping for End-to-End Learning of Alignment Paths

Stephen Gould, Michael Milford, Ming Xu, Sourav Garg

arXiv · PDF · Open in the Atlas

Code that ran

15 of 18 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, 0 violated it and 14 have no contract verdict; 1 failure of our instrument; 3 no recorded run), measured 2026-11-22; 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/2303.10778.json · badge: /api/ran/2303.10778.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
mingu6/declarativedtw canonical (classifier label)
classifier basis not recorded on the link
15 ran · 3 no recorded run
FunctionStatusWhere it lives
batched_tridiagonal_solve Ran
ran on a synthesized input
mingu6/declarativedtw/decdtw/backward/utils.py
code served (permissive licence) · get_code("cb46bd04c7ac2de9")
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 (2, 4, 3) 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 numpy as np

torch.manual_seed(0)

# Create a small batch of tridiagonal matrices
# A: (batch=2, n=4, n=4) - tridiagonal matrices
batch_size = 2
n = 4
k = 3  # number of RHS vectors

# Create tridiagonal matrices
A_list = []
for b in range(batch_size):
    # Create a tridiagonal matrix
    # Upper diagonal
    upper_diag = torch.randn(n - 1)
    # Main diagonal
    main_diag = torch.randn(n) + 3.0  # add offset to improve conditioning
    # Lower diagonal
    lower_diag = torch.randn(n - 1)
    
    # Construct full tridiagonal matrix
    A_mat = torch.diag(main_diag) + torch.diag(upper_diag, 1) + torch.diag(lower_diag, -1)
    A_list.append(A_mat)

A = torch.stack(A_list)  # (2, 4, 4)

# Create RHS matrices B: (batch=2, n=4, k=3)
B = torch.randn(batch_size, n, k)

ARGS = {
    "A": A,
    "B": B,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, 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 (2, 4, 3) — shape (2, 4, 3) 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
build_Omega Ran
ran on a synthesized input
mingu6/declarativedtw/experiments/audio_score/dilate_loss.py
code served (permissive licence) · get_code("6339ddb0b6dc5ae5")
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 (2, 4, 5) 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

torch.manual_seed(0)

# Build gt_warps: List (B) of tuple of (score_gt, perf_gt) tensors
# B=2 (batch size)
# Each element is a tuple of two tensors with matching first dimension (N_gt,i)

gt_warps = [
    (torch.tensor([0.5, 1.5, 2.5]), torch.tensor([0.1, 0.2, 0.3])),
    (torch.tensor([0.3, 1.2]), torch.tensor([0.15, 0.25]))
]

# s_t: B x N_s score observed times
# B=2, N_s=4
s_t = torch.tensor([
    [0.0, 1.0, 2.0, 3.0],
    [0.0, 0.5, 1.5, 2.5]
], dtype=torch.float32)

# p_t: B x N_p perf observed times
# B=2, N_p=5
p_t = torch.tensor([
    [0.0, 0.5, 1.0, 1.5, 2.0],
    [0.0, 0.3, 0.6, 0.9, 1.2]
], dtype=torch.float32)

ARGS = {
    "gt_warps": gt_warps,
    "s_t": s_t,
    "p_t": p_t
}
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 (2, 4, 5) — shape (2, 4, 5) 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
build_Omega Ran
ran on a synthesized input
mingu6/declarativedtw/experiments/vpr/dilate_loss.py
code served (permissive licence) · get_code("e5f415e497a655b9")
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 (2, 4, 3) 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

torch.manual_seed(0)

# Create small tensors for GPS coordinates
# gt_q: B x N_q x 2 (batch size 2, query points 4, GPS coords 2)
gt_q = torch.randn(2, 4, 2)

# gt_r: B x N_r x 2 (batch size 2, reference points 3, GPS coords 2)
gt_r = torch.randn(2, 3, 2)

# subseq: boolean flag for whether to add zero padding
subseq = False

ARGS = {
    "gt_q": gt_q,
    "gt_r": gt_r,
    "subseq": subseq,
}
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 (2, 4, 3) — shape (2, 4, 3) 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_softdtw Ran
ran on a synthesized input
mingu6/declarativedtw/experiments/audio_score/comparisons.py
code served (permissive licence) · get_code("63dedce93135c081")
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 ndarray, ndim 3, dtype family float, shape (2, 6, 5) 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 numpy as np

np.random.seed(0)

# The function compute_softdtw expects:
# - D: a 3D numpy array of shape (B, N, M) containing distance matrices
# - gamma: a float parameter for the soft-DTW computation

B = 2  # batch size
N = 4  # first sequence dimension
M = 3  # second sequence dimension

# Create a small distance matrix with random values
D = np.random.rand(B, N, M).astype(np.float64)

# gamma is a temperature parameter for soft-DTW
gamma = 1.0

ARGS = {
    "D": D,
    "gamma": gamma,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numba, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family float, shape (2, 6, 5) — shape (2, 6, 5) 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_softdtw Ran
ran on a synthesized input
mingu6/declarativedtw/experiments/audio_score/soft_dtw.py
code served (permissive licence) · get_code("de6839d7b9993193")
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 ndarray, ndim 2, dtype family float, shape (6, 5) 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 numpy as np

# The function compute_softdtw takes:
# - D: a 2D numpy array (distance matrix)
# - gamma: a float (temperature parameter)

# Create a small distance matrix
D = np.array([
    [1.0, 2.0, 3.0],
    [2.0, 1.0, 2.0],
    [3.0, 2.0, 1.0],
    [2.0, 3.0, 2.0]
], dtype=np.float64)

# gamma is a temperature parameter for the soft-DTW computation
gamma = 1.0

ARGS = {
    "D": D,
    "gamma": gamma
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numba, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (6, 5) — shape (6, 5) 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_softdtw_backward Ran
ran on a synthesized input
mingu6/declarativedtw/experiments/audio_score/comparisons.py
code served (permissive licence) · get_code("b7ef42ad24e33b6d")
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 ndarray, ndim 3, dtype family float, shape (2, 4, 3) 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 numpy as np

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

# Create small test data
B = 2  # batch size
N = 4  # first sequence dimension
M = 3  # second sequence dimension

# D_ is the cost matrix: shape (B, N, M)
D_ = np.random.randn(B, N, M).astype(np.float64)

# R is the accumulated cost matrix: shape (B, N+2, M+2)
# It gets padded internally but we pass the base version
R = np.random.randn(B, N + 2, M + 2).astype(np.float64)

# gamma is a temperature parameter (scalar)
gamma = 1.0

ARGS = {
    "D_": D_,
    "R": R,
    "gamma": gamma,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numba, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family float, shape (2, 4, 3) — shape (2, 4, 3) 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_softdtw_backward Ran
ran on a synthesized input
mingu6/declarativedtw/experiments/audio_score/soft_dtw.py
code served (permissive licence) · get_code("cfd049ad7b29f58c")
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 ndarray, ndim 2, dtype family float, shape (3, 4) 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 numpy as np

# Analyze the function signature and body:
# - D_: numpy array of shape (N, M), used to set D[1:N+1, 1:M+1]
# - R: numpy array of shape (N+2, M+2), modified in place and accessed throughout
# - gamma: float, used as divisor in computations

# Create small but distinct dimensions for N and M
N = 3
M = 4

# D_ is the cost matrix, shape (N, M)
# Initialize with small values for numerical stability
D_ = np.random.randn(N, M).astype(np.float64)

# R is the accumulated cost matrix with padding, shape (N+2, M+2)
# Initialize with large positive values (typical for DTW)
R = np.full((N + 2, M + 2), 1e10, dtype=np.float64)
# Set a reasonable starting value
R[0, 0] = 0.0

# gamma is the temperature parameter for softmax normalization
gamma = 1.0

ARGS = {
    "D_": D_,
    "R": R,
    "gamma": gamma,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numba, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (3, 4) — shape (3, 4) 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
constraints_grad_hGlbConstr Ran
ran on a synthesized input
mingu6/declarativedtw/decdtw/backward/constraints.py
code served (permissive licence) · get_code("b6981241440d2103")
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 torch

torch.manual_seed(0)

# Parameters for the function
batch_size = 2
N = 5  # number of warp time points (decision variables)

# Create index tensors for each batch element
# grad_lb_ind: indices where gradient lower bound constraints are active
grad_lb_ind = [
    torch.tensor([0, 2], dtype=torch.long),
    torch.tensor([1], dtype=torch.long)
]

# grad_ub_ind: indices where gradient upper bound constraints are active
grad_ub_ind = [
    torch.tensor([1], dtype=torch.long),
    torch.tensor([0, 2, 3], dtype=torch.long)
]

# glb_lb_ind: indices where global R-K lower bound constraints are active
glb_lb_ind = [
    torch.tensor([2], dtype=torch.long),
    torch.tensor([1, 3], dtype=torch.long)
]

# glb_ub_ind: indices where global R-K upper bound constraints are active
glb_ub_ind = [
    torch.tensor([3, 4], dtype=torch.long),
    torch.tensor([2], dtype=torch.long)
]

# bnd_lb_ind: indices where lower boundary (non-negativity) constraints are active
bnd_lb_ind = [
    torch.tensor([0], dtype=torch.long),
    torch.tensor([1, 4], dtype=torch.long)
]

# bnd_ub_ind: indices where upper boundary (max value) constraints are active
bnd_ub_ind = [
    torch.tensor([4], dtype=torch.long),
    torch.tensor([3], dtype=torch.long)
]

ARGS = {
    "grad_lb_ind": grad_lb_ind,
    "grad_ub_ind": grad_ub_ind,
    "glb_lb_ind": glb_lb_ind,
    "glb_ub_ind": glb_ub_ind,
    "bnd_lb_ind": bnd_lb_ind,
    "bnd_ub_ind": bnd_ub_ind,
    "N": N,
    "subseq_enabled": True,
    "dtype": torch.float32,
    "device": torch.device("cpu")
}
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 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
constraints_grad_hY Ran
ran on a synthesized input
mingu6/declarativedtw/decdtw/backward/constraints.py
code served (permissive licence) · get_code("4c25b91eb64a6b88")
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 list. 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
from typing import List

torch.manual_seed(0)

# N is the number of warp time points (decision variables)
N = 5

# Create batch size of 2
batch_size = 2

# dtype and device
dtype = torch.float32
device = torch.device('cpu')

# Create index tensors for each batch element
# These represent indices where constraints are active
# Keep them small and varied

# Batch element 1
grad_lb_ind_1 = torch.tensor([0, 1], dtype=torch.long, device=device)
grad_ub_ind_1 = torch.tensor([2], dtype=torch.long, device=device)
glb_lb_ind_1 = torch.tensor([1, 2], dtype=torch.long, device=device)
glb_ub_ind_1 = torch.tensor([3], dtype=torch.long, device=device)
bnd_lb_ind_1 = torch.tensor([0], dtype=torch.long, device=device)
bnd_ub_ind_1 = torch.tensor([4], dtype=torch.long, device=device)

# Batch element 2
grad_lb_ind_2 = torch.tensor([1], dtype=torch.long, device=device)
grad_ub_ind_2 = torch.tensor([2, 3], dtype=torch.long, device=device)
glb_lb_ind_2 = torch.tensor([0], dtype=torch.long, device=device)
glb_ub_ind_2 = torch.tensor([2, 3], dtype=torch.long, device=device)
bnd_lb_ind_2 = torch.tensor([], dtype=torch.long, device=device)
bnd_ub_ind_2 = torch.tensor([4], dtype=torch.long, device=device)

# Construct argument lists
grad_lb_ind = [grad_lb_ind_1, grad_lb_ind_2]
grad_ub_ind = [grad_ub_ind_1, grad_ub_ind_2]
glb_lb_ind = [glb_lb_ind_1, glb_lb_ind_2]
glb_ub_ind = [glb_ub_ind_1, glb_ub_ind_2]
bnd_lb_ind = [bnd_lb_ind_1, bnd_lb_ind_2]
bnd_ub_ind = [bnd_ub_ind_1, bnd_ub_ind_2]

ARGS = {
    'grad_lb_ind': grad_lb_ind,
    'grad_ub_ind': grad_ub_ind,
    'glb_lb_ind': glb_lb_ind,
    'glb_ub_ind': glb_ub_ind,
    'bnd_lb_ind': bnd_lb_ind,
    'bnd_ub_ind': bnd_ub_ind,
    'N': N,
    'subseq_enabled': True,
    'dtype': dtype,
    'device': device
}
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 list — a list 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
map_score Ran
ran on a synthesized input
mingu6/declarativedtw/experiments/audio_score/datasets.py
code served (permissive licence) · get_code("c011f7bc2d35843a")
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 str. 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 re

def map_score(perf):
    """ taken from alignment-eval repo for convenience """
    ' associate a performance midi with a kern score based on filename conventions '
    regex = re.compile('(\\d\\d\\d)_bwv(\\d\\d\\d)(f|p)')
    info = regex.search(perf)
    num, bwv, part = info.group(1, 2, 3)
    bwv = int(bwv)
    book = 1 + int(bwv > 869)
    score = 'wtc{}{}{:02d}'.format(book, part, bwv - 845 - (book - 1) * 24)
    return score

# The function expects a string parameter 'perf' that matches a regex pattern
# Pattern: (3 digits)_bwv(3 digits)(f or p)
# Example: "001_bwv846f" or "042_bwv869p"

ARGS = {
    'perf': '001_bwv846f'
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
my_max Ran
ran on a synthesized input
mingu6/declarativedtw/experiments/audio_score/path_soft_dtw.py
code served (permissive licence) · get_code("ac24165407fc997f")
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
from numba import jit

@jit(nopython=True)
def my_max(x, gamma):
    max_x = np.max(x)
    exp_x = np.exp((x - max_x) / gamma)
    Z = np.sum(exp_x)
    return (gamma * np.log(Z) + max_x, exp_x / Z)

# Setup code
x = np.array([1.0, 2.5, 0.3, 1.8, 3.2, 0.9], dtype=np.float64)
gamma = 0.5

ARGS = {
    "x": x,
    "gamma": gamma
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numba, numpy — 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
my_max_hessian_product Ran
ran on a synthesized input
mingu6/declarativedtw/experiments/audio_score/path_soft_dtw.py
code served (permissive licence) · get_code("2762a706aba6e342")
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 ndarray, ndim 1, dtype family float, shape (4,) 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 numpy as np
import torch

# Set seed for reproducibility
torch.manual_seed(0)

# Analyze the function: my_max_hessian_product(p, z, gamma)
# - p: appears in multiplication and np.sum operations, should be a numeric array
# - z: appears in multiplication and np.sum operations, should be a numeric array  
# - gamma: scalar used as divisor
# - Operations: p * z, np.sum(p * z), element-wise division by gamma
# All parameters should be numpy arrays or compatible numeric types

# Create small distinct-sized test data
p = np.array([0.1, 0.2, 0.3, 0.4], dtype=np.float64)
z = np.array([1.0, 2.0, 3.0, 4.0], dtype=np.float64)
gamma = 0.5

ARGS = {
    "p": p,
    "z": z,
    "gamma": gamma,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numba, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (4,) — shape (4,) 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
my_min Ran
ran on a synthesized input
mingu6/declarativedtw/experiments/audio_score/path_soft_dtw.py
code served (permissive licence) · get_code("f0e6c9e94033d95b")
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
from numba import jit

@jit(nopython=True)
def my_max(x, gamma):
    max_x = np.max(x)
    exp_x = np.exp((x - max_x) / gamma)
    Z = np.sum(exp_x)
    return (gamma * np.log(Z) + max_x, exp_x / Z)

@jit(nopython=True)
def my_min(x, gamma):
    min_x, argmax_x = my_max(-x, gamma)
    return (-min_x, argmax_x)

# Setup code to construct valid arguments
x = np.array([1.0, 2.5, 0.3, -1.2], dtype=np.float64)
gamma = 0.5

ARGS = {
    "x": x,
    "gamma": gamma
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numba, numpy — 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
pairwise_distances Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mingu6/declarativedtw/experiments/audio_score/soft_dtw.py
code served (permissive licence) · get_code("f18232ab89e49092")
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 (2, 3) 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

torch.manual_seed(0)

# Create two small matrices for testing pairwise_distances
# x: Nxd matrix (2 samples, 4 dimensions)
x = torch.randn(2, 4)

# y: Mxd matrix (3 samples, 4 dimensions)
# Using distinct size (3) from N (2) to make dimensions unambiguous
y = torch.randn(3, 4)

ARGS = {
    "x": x,
    "y": y
}
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 (2, 3) — shape (2, 3) 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
warp_fn_glb_bounds Ran
ran on a synthesized input
mingu6/declarativedtw/decdtw/gdtw_solver/dp_graph.py
code served (permissive licence) · get_code("af12f07b5f7014ec")
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 torch
import torch.nn as nn

torch.manual_seed(0)

# Parameters for the function
B = 2  # batch size
N = 4  # time steps

# Create time tensors - warp function times
warp_fn_times = torch.linspace(0, 10, N).unsqueeze(0).expand(B, -1)

# Reference signal observed times
signal1_times = torch.linspace(0, 8, N).unsqueeze(0).expand(B, -1)

# Local gradient lower bounds (B x N-1)
local_lb_vals = torch.ones(B, N - 1) * 0.5

# Local gradient upper bounds (B x N-1)
local_ub_vals = torch.ones(B, N - 1) * 2.0

# Global band lower bounds (B x N)
glb_band_lb = torch.zeros(B, N)

# Global band upper bounds (B x N)
glb_band_ub = torch.linspace(0, 12, N).unsqueeze(0).expand(B, -1)

# Subsequence enabled flag
subseq_enabled = False

ARGS = {
    "warp_fn_times": warp_fn_times,
    "signal1_times": signal1_times,
    "local_lb_vals": local_lb_vals,
    "local_ub_vals": local_ub_vals,
    "glb_band_lb": glb_band_lb,
    "glb_band_ub": glb_band_ub,
    "subseq_enabled": subseq_enabled,
}
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 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
dtw_objective Not yet run
unverified (harvested, no recorded run)
mingu6/declarativedtw/decdtw/utils.py
code served (permissive licence) · get_code("3c2564bf11c3f00c")
How it ran

no invocation recorded.

regularisation_loss Not yet run
unverified (harvested, no recorded run)
mingu6/declarativedtw/decdtw/utils.py
code served (permissive licence) · get_code("e0a7117c444fa4cb")
How it ran

no invocation recorded.

signal_error Not yet run
unverified (harvested, no recorded run)
mingu6/declarativedtw/decdtw/utils.py
code served (permissive licence) · get_code("d4bac3ed82144852")
How it ran

no invocation recorded.

Also present in other papers' code

Of 18 samples lifted from this paper's linked repositories, 18 carry a function identity and 0 do not. Of the 18 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 17 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.

FunctionAlso present inEarliest-datedOthers named
pairwise_distances 1 other paper
1 dated earlier
1909.09020 (2019-09)
Shape and Time Distortion Loss for Training Deep Time Series Forecasting Models

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

This paper addresses learning end-to-end models for time series data that include a temporal alignment step via dynamic time warping (DTW). Existing approaches to differentiable DTW either differentiate through a fixed warping path or apply a differentiable relaxation to the min operator found in the recursive steps used to solve the DTW problem. We instead propose a DTW layer based around bilevel optimisation and deep declarative networks, which we name DecDTW. By formulating DTW as a continuous, inequality constrained optimisation problem, we can compute gradients for the solution of the optimal alignment (with respect to the underlying time series) using implicit differentiation. An interesting byproduct of this formulation is that DecDTW outputs the optimal warping path between two time series as opposed to a soft approximation, recoverable from Soft-DTW. We show that this property is particularly useful for applications where downstream loss functions are defined on the optimal alignment path itself. This naturally occurs, for instance, when learning to improve the accuracy of predicted alignments against ground truth alignments. We evaluate DecDTW on two such applications, namely the audio-to-score alignment task in music information retrieval and the visual place recognition task in robotics, demonstrating state-of-the-art results in both.

For agents

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

get_harvested_code_for_paper("2303.10778")
get_code_for_paper("2303.10778")
have("2303.10778")

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

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

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

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

Connect an agent — have() is free.