SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2107.08273 · ICML · 2021

STRODE: Stochastic Boundary Ordinary Differential Equation

Hao Wang, Hengguan Huang, Ye Wang, Hongfu Liu, Chang Xiao

arXiv · PDF · Open in the Atlas

Code that ran

6 of 9 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 5 have no contract verdict; 1 failure of our instrument; 3 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/2107.08273.json · badge: /api/ran/2107.08273.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
Waffle-Liu/STRODE marked official in Papers with Code
Papers with Code archive
6 ran · 3 no recorded run
FunctionStatusWhere it lives
FullNN_Phi Ran
ran on a synthesized input
Waffle-Liu/STRODE/rotatingMNIST/model.py
code served (permissive licence) · get_code("a2d02bb8b8af3205")
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 numpy as np
import torch.nn.functional as F

class NonpositiveLinear(nn.Linear):

    def reset_parameters(self):
        nn.init.xavier_uniform_(self.weight)
        self.weight.data.abs_()
        self.weight.data.mul_(-1.0)
        if self.bias is not None:
            fan_in, _ = nn.init._calculate_fan_in_and_fan_out(self.weight)
            bound = 1 / np.sqrt(fan_in)
            nn.init.uniform_(self.bias, -bound, bound)

    def forward(self, input):
        self.weight.data.clamp_(max=0.0)
        return F.linear(input, self.weight, self.bias)

class FullNN_Phi(nn.Module):

    def __init__(self, h_dim, time_dim=64, n_full_layers=2):
        super(FullNN_Phi, self).__init__()
        self.time_dim = time_dim
        self.n_full_layers = n_full_layers
        self.linear_time = NonpositiveLinear(1, time_dim, bias=False)
        self.linear_time_layers = nn.ModuleList([NonpositiveLinear(time_dim, time_dim, bias=False) for _ in range(n_full_layers - 1)])
        self.final_time_layer = NonpositiveLinear(time_dim, 1, bias=False)
        self.dense_p = NonpositiveLinear(h_dim, time_dim, bias=False)
        self.linear_p_layers = nn.ModuleList([NonpositiveLinear(time_dim, time_dim, bias=False) for _ in range(n_full_layers - 1)])
        self.final_p_layer = NonpositiveLinear(time_dim, 1, bias=False)
        self.c = 2.0

    def mlp(self, input_x, input_rnn):
        hidden_x = self.linear_time(input_x)
        for i in range(self.n_full_layers - 1):
            hidden_x = self.linear_time_layers[i](hidden_x)
            hidden_x = torch.tanh(hidden_x)
        hidden_x = self.final_time_layer(hidden_x)
        hidden_p = self.dense_p(input_rnn)
        for i in range(self.n_full_layers - 1):
            hidden_p = self.linear_p_layers[i](hidden_p)
            hidden_p = torch.tanh(hidden_p)
        hidden_p = self.final_p_layer(hidden_p)
        hidden = hidden_x + hidden_p
        hidden = F.softplus(hidden)
        return hidden + input_x.detach()

    def forward(self, input_x, input_rnn, mode='train'):
        integral = self.mlp(input_x, input_rnn)
        if mode == 'train':
            derivative = torch.autograd.grad(integral, input_x, torch.ones_like(integral), create_graph=True)[0]
        else:
            derivative = torch.ones_like(integral)
        return (integral, derivative)


INIT_ARGS = {
    'h_dim': 4,
    'time_dim': 8,
    'n_full_layers': 2,
}

ARGS = {
    'input_x': torch.randn(2, 1, requires_grad=True),
    'input_rnn': torch.randn(2, 4),
    'mode': 'train',
}

if __name__ == '__main__':
    model = FullNN_Phi(**INIT_ARGS)
    integral, derivative = model(**ARGS)
    print(f"Integral shape: {integral.shape}")
    print(f"Derivative shape: {derivative.shape}")
    print(f"Integral: {integral}")
    print(f"Derivative: {derivative}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, 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)
FullNN_phi Ran
ran on a synthesized input
Waffle-Liu/STRODE/rotatingMNIST/model.py
code served (permissive licence) · get_code("adb7535b2a9bf87d")
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 numpy as np
import torch.nn.functional as F

class NonnegativeLinear(nn.Linear):

    def reset_parameters(self):
        nn.init.xavier_uniform_(self.weight)
        self.weight.data.abs_()
        if self.bias is not None:
            fan_in, _ = nn.init._calculate_fan_in_and_fan_out(self.weight)
            bound = 1 / np.sqrt(fan_in)
            nn.init.uniform_(self.bias, -bound, bound)

    def forward(self, input):
        self.weight.data.clamp_(0.0)
        return F.linear(input, self.weight, self.bias)

class FullNN_phi(nn.Module):

    def __init__(self, h_dim, time_dim=64, n_full_layers=2):
        super(FullNN_phi, self).__init__()
        self.time_dim = time_dim
        self.n_full_layers = n_full_layers
        self.linear_time = NonnegativeLinear(1, time_dim)
        self.linear_time_layers = nn.ModuleList([NonnegativeLinear(time_dim, time_dim) for _ in range(n_full_layers - 1)])
        self.final_time_layer = NonnegativeLinear(time_dim, 1)
        self.dense_p = NonnegativeLinear(h_dim, time_dim)
        self.linear_p_layers = nn.ModuleList([NonnegativeLinear(time_dim, time_dim) for _ in range(n_full_layers - 1)])
        self.final_p_layer = NonnegativeLinear(time_dim, 1)

    def mlp(self, input_x, input_rnn):
        hidden_x = self.linear_time(input_x)
        for i in range(self.n_full_layers - 1):
            hidden_x = self.linear_time_layers[i](hidden_x)
            hidden_x = torch.tanh(hidden_x)
        hidden_x = self.final_time_layer(hidden_x)
        hidden_p = self.dense_p(input_rnn)
        for i in range(self.n_full_layers - 1):
            hidden_p = self.linear_p_layers[i](hidden_p)
            hidden_p = torch.tanh(hidden_p)
        hidden_p = self.final_p_layer(hidden_p)
        hidden = hidden_x + hidden_p
        hidden = F.softplus(hidden)
        return hidden + input_x.detach()

    def forward(self, input_x, input_rnn, mode='train'):
        integral = self.mlp(input_x, input_rnn)
        if mode == 'train':
            derivative = torch.autograd.grad(integral, input_x, torch.ones_like(integral), create_graph=True)[0]
        else:
            derivative = torch.ones_like(integral)
        return (integral, derivative)

INIT_ARGS = {
    'h_dim': 4,
    'time_dim': 8,
    'n_full_layers': 2,
}

ARGS = {
    'input_x': torch.randn(2, 1, requires_grad=True),
    'input_rnn': torch.randn(2, 4),
    'mode': 'train',
}

if __name__ == '__main__':
    model = FullNN_phi(**INIT_ARGS)
    integral, derivative = model(**ARGS)
    print(f"integral shape: {integral.shape}")
    print(f"derivative shape: {derivative.shape}")
    print(f"integral: {integral}")
    print(f"derivative: {derivative}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, 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)
NonnegativeLinear Ran
ran on a synthesized input
Waffle-Liu/STRODE/rotatingMNIST/model.py
code served (permissive licence) · get_code("3e4cf556fe428225")
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 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
import torch.nn as nn
import numpy as np
import torch.nn.functional as F

class NonnegativeLinear(nn.Linear):

    def reset_parameters(self):
        nn.init.xavier_uniform_(self.weight)
        self.weight.data.abs_()
        if self.bias is not None:
            fan_in, _ = nn.init._calculate_fan_in_and_fan_out(self.weight)
            bound = 1 / np.sqrt(fan_in)
            nn.init.uniform_(self.bias, -bound, bound)

    def forward(self, input):
        self.weight.data.clamp_(0.0)
        return F.linear(input, self.weight, self.bias)


INIT_ARGS = {
    'in_features': 4,
    'out_features': 3,
    'bias': True
}

ARGS = {
    'input': torch.randn(2, 4)
}

if __name__ == '__main__':
    layer = NonnegativeLinear(**INIT_ARGS)
    output = layer(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output:\n{output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
NonpositiveLinear Ran
ran on a synthesized input
Waffle-Liu/STRODE/rotatingMNIST/model.py
code served (permissive licence) · get_code("3798340940bb7e3d")
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 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
import torch.nn as nn
import numpy as np
import torch.nn.functional as F

class NonpositiveLinear(nn.Linear):

    def reset_parameters(self):
        nn.init.xavier_uniform_(self.weight)
        self.weight.data.abs_()
        self.weight.data.mul_(-1.0)
        if self.bias is not None:
            fan_in, _ = nn.init._calculate_fan_in_and_fan_out(self.weight)
            bound = 1 / np.sqrt(fan_in)
            nn.init.uniform_(self.bias, -bound, bound)

    def forward(self, input):
        self.weight.data.clamp_(max=0.0)
        return F.linear(input, self.weight, self.bias)


INIT_ARGS = {
    'in_features': 4,
    'out_features': 3,
    'bias': True
}

ARGS = {
    'input': torch.randn(2, 4)
}

if __name__ == '__main__':
    layer = NonpositiveLinear(**INIT_ARGS)
    output = layer(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output:\n{output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ODEFunc Ran
ran on a synthesized input
Waffle-Liu/STRODE/rotatingMNIST/model.py
code served (permissive licence) · get_code("187b96c753458507")
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 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
import torch.nn as nn

def init_network_weights(net, std=0.1):
    for m in net.modules():
        if isinstance(m, nn.Linear):
            nn.init.normal_(m.weight, mean=0, std=std)
            nn.init.constant_(m.bias, val=0)

class ODEFunc(nn.Module):

    def __init__(self, input_dim, latent_dim, ode_func_net, device=torch.device('cpu')):
        """
        input_dim: dimensionality of the input
        latent_dim: dimensionality used for ODE. Analog of a continous latent state
        """
        super(ODEFunc, self).__init__()
        self.input_dim = input_dim
        self.device = device
        init_network_weights(ode_func_net)
        self.gradient_net = ode_func_net

    def forward(self, t_local, y, backwards=False):
        """
        Perform one step in solving ODE. Given current data point y and current time point t_local, returns gradient dy/dt at this time point

        t_local: current time point
        y: value at the current time point
        """
        grad = self.get_ode_gradient_nn(t_local, y)
        if backwards:
            grad = -grad
        return grad

    def get_ode_gradient_nn(self, t_local, y):
        return self.gradient_net(y)


# Create a small gradient network
gradient_net = nn.Sequential(
    nn.Linear(4, 8),
    nn.ReLU(),
    nn.Linear(8, 3)
)

INIT_ARGS = {
    'input_dim': 4,
    'latent_dim': 3,
    'ode_func_net': gradient_net,
    'device': torch.device('cpu')
}

ARGS = {
    't_local': 0.5,
    'y': torch.randn(2, 4),
    'backwards': False
}
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 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
create_net Ran
ran; our contract draft was wrong, not the code
Waffle-Liu/STRODE/rotatingMNIST/model.py
code served (permissive licence) · get_code("d304a70588f7003b")
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 Sequential. 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)

ARGS = {
    "n_inputs": 4,
    "n_outputs": 3,
    "n_layers": 2,
    "n_units": 8,
    "nonlinear": nn.Tanh
}
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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential 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
DiffeqSolver Not yet run
unverified (harvested, no recorded run)
Waffle-Liu/STRODE/rotatingMNIST/model.py
code served (permissive licence) · get_code("34d297db13f1311d")
How it ran

no invocation recorded.

DiffeqSolver_KL Not yet run
unverified (harvested, no recorded run)
Waffle-Liu/STRODE/rotatingMNIST/model.py
code served (permissive licence) · get_code("d9be40a1d9b49174")
How it ran

no invocation recorded.

STRODE Not yet run
unverified (harvested, no recorded run)
Waffle-Liu/STRODE/rotatingMNIST/model.py
code served (permissive licence) · get_code("e6b1d48c05e70281")
How it ran

no invocation recorded.

Also present in other papers' code

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

Perception of time from sequentially acquired sensory inputs is rooted in everyday behaviors of individual organisms. Yet, most algorithms for time-series modeling fail to learn dynamics of random event timings directly from visual or audio inputs, requiring timing annotations during training that are usually unavailable for real-world applications. For instance, neuroscience perspectives on postdiction imply that there exist variable temporal ranges within which the incoming sensory inputs can affect the earlier perception, but such temporal ranges are mostly unannotated for real applications such as automatic speech recognition (ASR). In this paper, we present a probabilistic ordinary differential equation (ODE), called STochastic boundaRy ODE (STRODE 1 ), that learns both the timings and the dynamics of time series data without requiring any timing annotations during training. STRODE allows the usage of differential equations to sample from the posterior point processes, efficiently and analytically. We further provide theoretical guarantees on the learning of STRODE. Our empirical results show that our approach successfully infers event timings of time series data. Our method achieves competitive or superior performances compared to existing state-of-the-art methods for both synthetic and real-world datasets.

For agents

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

get_harvested_code_for_paper("2107.08273")
get_code_for_paper("2107.08273")
have("2107.08273")

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

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

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

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

Connect an agent — have() is free.