SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2506.12622 · ICLR · 2025

DR-SAC: Distributionally Robust Soft Actor-Critic for Reinforcement Learning under Uncertainty

Huan Zhang, Zhengyuan Zhou, Yuxuan Han, Duo Zhou, Grani Hanasusanto, Mingxuan Cui, Qiong Wang

arXiv · PDF · Open in the Atlas

Code that ran

11 of 16 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; 1 honoured the contract we drafted, 0 violated it and 9 have no contract verdict; 1 failure of our instrument; 5 no recorded run), measured 2026-11-24; 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/2506.12622.json · badge: /api/ran/2506.12622.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
lemutisme/dr-sac canonical (classifier label)
classifier basis: classifier_2025
11 ran · 5 no recorded run
FunctionStatusWhere it lives
Actor Ran
ran on a synthesized input
lemutisme/dr-sac/sac.py
code served (permissive licence) · get_code("b3d3944663449c1a")
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 numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Normal

def build_net(layer_shape, hidden_activation, output_activation):
    """Build a feedforward network with a simple for-loop."""
    layers = []
    for j in range(len(layer_shape) - 1):
        layers += [nn.Linear(layer_shape[j], layer_shape[j + 1])]
        act = hidden_activation if j < len(layer_shape) - 2 else output_activation
        layers += [act()]
    return nn.Sequential(*layers)

class Actor(nn.Module):

    def __init__(self, state_dim: int, action_dim: int, max_action: float, hid_dim: list, hid_layers: int, hidden_activation=nn.ReLU, output_activation=nn.ReLU):
        super(Actor, self).__init__()
        layers = [state_dim] + hid_dim * hid_layers
        self.a_net = build_net(layers, hidden_activation, output_activation)
        self.mu_layer = nn.Linear(layers[-1], action_dim)
        self.log_std_layer = nn.Linear(layers[-1], action_dim)
        self.LOG_STD_MAX = 2
        self.LOG_STD_MIN = -20
        self.max_action = max_action
        for layer in self.a_net[0:-1:2]:
            torch.nn.init.constant_(layer.bias, 0.1)
        torch.nn.init.uniform_(self.mu_layer.weight, -0.001, 0.001)
        torch.nn.init.uniform_(self.mu_layer.bias, -0.001, 0.001)
        torch.nn.init.uniform_(self.log_std_layer.weight, -0.001, 0.001)
        torch.nn.init.uniform_(self.log_std_layer.bias, -0.001, 0.001)

    def forward(self, state, deterministic, with_logprob):
        """Network forward pass with enforced action bounds."""
        net_out = self.a_net(state)
        mu = self.mu_layer(net_out)
        log_std = self.log_std_layer(net_out)
        log_std = torch.clamp(log_std, min=self.LOG_STD_MIN, max=self.LOG_STD_MAX)
        std = torch.exp(log_std)
        dist = Normal(mu, std)
        u = mu if deterministic else dist.rsample()
        a = torch.tanh(u)
        if with_logprob:
            logp_pi_a = dist.log_prob(u).sum(axis=1, keepdim=True) - (2 * (np.log(2) - u - F.softplus(-2 * u))).sum(axis=1, keepdim=True)
        else:
            logp_pi_a = None
        return (a * self.max_action, logp_pi_a)


INIT_ARGS = {
    'state_dim': 4,
    'action_dim': 3,
    'max_action': 1.0,
    'hid_dim': [8],
    'hid_layers': 2,
    'hidden_activation': nn.ReLU,
    'output_activation': nn.ReLU,
}

ARGS = {
    'state': torch.randn(2, 4),
    'deterministic': False,
    'with_logprob': True,
}

if __name__ == '__main__':
    actor = Actor(**INIT_ARGS)
    output = actor(**ARGS)
    print("Output shapes:", output[0].shape, output[1].shape if output[1] is not None else None)
    print("Test passed!")
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)
ConditionalFlow Ran
ran on a synthesized input
lemutisme/dr-sac/sac.py
code served (permissive licence) · get_code("0a44e3fb45c1c563")
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

# INIT_ARGS for ConditionalFlow.__init__(state_dim, action_dim, hidden_dim=128)
INIT_ARGS = {
    'state_dim': 6,
    'action_dim': 3,
    'hidden_dim': [16, 16]  # list of hidden dimensions for build_net
}

# ARGS for forward method: forward_flow(x, s, a)
# x: s_next_norm (B, state_dim)
# s: s_norm (B, state_dim)
# a: action (B, action_dim)
ARGS = {
    'x': torch.randn(2, 6),  # batch=2, state_dim=6
    's': torch.randn(2, 6),  # batch=2, state_dim=6
    'a': torch.randn(2, 3)   # batch=2, action_dim=3
}

METHOD = 'forward_flow'
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)
Double_Q_Critic Ran
ran on a synthesized input
lemutisme/dr-sac/sac.py
code served (permissive licence) · get_code("f7a6c367bf781d9e")
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

def build_net(layer_shape, hidden_activation, output_activation):
    """Build a feedforward network with a simple for-loop."""
    layers = []
    for j in range(len(layer_shape) - 1):
        layers += [nn.Linear(layer_shape[j], layer_shape[j + 1])]
        act = hidden_activation if j < len(layer_shape) - 2 else output_activation
        layers += [act()]
    return nn.Sequential(*layers)

class Double_Q_Critic(nn.Module):

    def __init__(self, state_dim: int, action_dim: int, hid_dim: list[int], hid_layers: int):
        super(Double_Q_Critic, self).__init__()
        layers = [state_dim + action_dim] + hid_dim * hid_layers + [1]
        self.Q_1 = build_net(layers, nn.ReLU, nn.Identity)
        self.Q_2 = build_net(layers, nn.ReLU, nn.Identity)

    def forward(self, state, action):
        sa = torch.cat([state, action], dim=1)
        q1 = self.Q_1(sa)
        q2 = self.Q_2(sa)
        return (q1, q2)


INIT_ARGS = {
    'state_dim': 4,
    'action_dim': 3,
    'hid_dim': [8],
    'hid_layers': 2,
}

ARGS = {
    'state': torch.randn(2, 4),
    'action': torch.randn(2, 3),
}

if __name__ == '__main__':
    model = Double_Q_Critic(**INIT_ARGS)
    q1, q2 = model(**ARGS)
    print(f"Q1 shape: {q1.shape}, Q2 shape: {q2.shape}")
    print(f"Q1: {q1}")
    print(f"Q2: {q2}")
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)
ExpActivation Ran
ran on a synthesized input
lemutisme/dr-sac/sac.py
code served (permissive licence) · get_code("7cb17db081d21d11")
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, 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 torch
import torch.nn as nn

class ExpActivation(nn.Module):

    def forward(self, x):
        return torch.exp(x)

INIT_ARGS = {}

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

# Construct and call
module = ExpActivation(**INIT_ARGS)
output = module(**ARGS)
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, 4) — shape (2, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
MLPTransitionVAE Ran
ran on a synthesized input
lemutisme/dr-sac/sac.py
code served (permissive licence) · get_code("0b400e7c6cd4e03d")
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

def build_net(layer_shape, hidden_activation, output_activation):
    """Build a feedforward network with a simple for-loop."""
    layers = []
    for j in range(len(layer_shape) - 1):
        layers += [nn.Linear(layer_shape[j], layer_shape[j + 1])]
        act = hidden_activation if j < len(layer_shape) - 2 else output_activation
        layers += [act()]
    return nn.Sequential(*layers)

class MLPTransitionVAE(nn.Module):

    def __init__(self, state_dim: int, action_dim: int, hidden_dim: list[int], hidden_layer: int, latent_dim: int):
        super(MLPTransitionVAE, self).__init__()
        e_layers = [state_dim * 2 + action_dim] + hidden_dim * hidden_layer
        self.encoder = build_net(e_layers, nn.ReLU, nn.Identity)
        self.e_mu = nn.Linear(e_layers[-1], latent_dim)
        self.e_logvar = nn.Linear(e_layers[-1], latent_dim)
        d_layers = [state_dim + action_dim + latent_dim] + hidden_dim * hidden_layer + [state_dim]
        self.decoder = build_net(d_layers, nn.ReLU, nn.Identity)
        self.latent_dim = latent_dim

    def encode(self, s, a, s_next):
        x = torch.cat([s, a, s_next], dim=1)
        h = self.encoder(x)
        mu = self.e_mu(h)
        logvar = self.e_logvar(h)
        return (mu, logvar)

    def reparameterize(self, mu, logvar):
        std = torch.exp(0.5 * logvar)
        eps = torch.randn_like(std)
        return mu + eps * std

    def decode(self, s, a, z):
        x = torch.cat([s, a, z], dim=-1)
        s_next_recon = self.decoder(x)
        return s_next_recon

    def forward(self, s, a, s_next):
        mu, logvar = self.encode(s, a, s_next)
        z = self.reparameterize(mu, logvar)
        s_next_recon = self.decode(s, a, z)
        return (s_next_recon, mu, logvar)

    def sample(self, s, a, num_samples):
        batch_size = s.size(0)
        z = torch.randn(batch_size, num_samples, self.latent_dim, device=s.device)
        s_expanded = s.unsqueeze(1).expand(-1, num_samples, -1)
        a_expanded = a.unsqueeze(1).expand(-1, num_samples, -1)
        s_next_samples = self.decode(s_expanded, a_expanded, z)
        return s_next_samples


INIT_ARGS = {
    'state_dim': 4,
    'action_dim': 3,
    'hidden_dim': [8],
    'hidden_layer': 2,
    'latent_dim': 5,
}

ARGS = {
    's': torch.randn(2, 4),
    'a': torch.randn(2, 3),
    's_next': torch.randn(2, 4),
}

model = MLPTransitionVAE(**INIT_ARGS)
output = model(**ARGS)
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)
Reward_adapter Ran
ran, honoured the contract we drafted
lemutisme/dr-sac/sac.py
code served (permissive licence) · get_code("1f773658fe04f371")
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 float, 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 torch
import numpy as np

torch.manual_seed(0)

# Based on the function signature and body:
# - r: appears to be a numeric value (int or float) that gets arithmetically manipulated
# - EnvIndex: appears to be an integer used for conditional branching

# Test with a simple numeric reward value
r = 5.0
EnvIndex = 0

ARGS = {
    "r": r,
    "EnvIndex": EnvIndex
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, 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
SigmaMLP Ran
ran on a synthesized input
lemutisme/dr-sac/sac.py
code served (permissive licence) · get_code("9922874222e5181e")
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, 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 torch
import torch.nn as nn
import torch.nn.functional as F

class SigmaMLP(nn.Module):
    """
    Tiny embedding network for the noise level sigma.
    Input: log(sigma) as a scalar
    Output: sigma embedding vector
    """

    def __init__(self, emb_dim):
        super().__init__()
        self.fc1 = nn.Linear(1, emb_dim)
        self.fc2 = nn.Linear(emb_dim, emb_dim)

    def forward(self, log_sigma):
        x = F.relu(self.fc1(log_sigma))
        x = F.relu(self.fc2(x))
        return x


INIT_ARGS = {
    'emb_dim': 4
}

ARGS = {
    'log_sigma': torch.randn(2, 1)
}

if __name__ == '__main__':
    model = SigmaMLP(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Input shape: {ARGS['log_sigma'].shape}")
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
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, 4) — shape (2, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
TimeMLP Ran
ran on a synthesized input
lemutisme/dr-sac/sac.py
code served (permissive licence) · get_code("0479c4e4d9929e23")
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 3, dtype family float, shape (2, 1, 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 torch
import torch.nn as nn
import torch.nn.functional as F

class TimeMLP(nn.Module):
    """Minimal timestep embedding: scalar t -> vector embedding."""

    def __init__(self, emb_dim):
        super().__init__()
        self.fc1 = nn.Linear(1, emb_dim)
        self.fc2 = nn.Linear(emb_dim, emb_dim)

    def forward(self, t):
        t = t.float().unsqueeze(-1)
        x = F.relu(self.fc1(t))
        x = F.relu(self.fc2(x))
        return x


INIT_ARGS = {
    'emb_dim': 4,
}

ARGS = {
    't': torch.tensor([[0.5], [0.3]]),
}

if __name__ == '__main__':
    model = TimeMLP(**INIT_ARGS)
    output = model(**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
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, 1, 4) — shape (2, 1, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
V_Critic Ran
ran on a synthesized input
lemutisme/dr-sac/sac.py
code served (permissive licence) · get_code("0810f0b60522aad2")
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, 1) 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 build_net(layer_shape, hidden_activation, output_activation):
    """Build a feedforward network with a simple for-loop."""
    layers = []
    for j in range(len(layer_shape) - 1):
        layers += [nn.Linear(layer_shape[j], layer_shape[j + 1])]
        act = hidden_activation if j < len(layer_shape) - 2 else output_activation
        layers += [act()]
    return nn.Sequential(*layers)

class V_Critic(nn.Module):

    def __init__(self, state_dim: int, hid_dim: list[int], hid_layers: int):
        super(V_Critic, self).__init__()
        self.state_dim = state_dim
        layers = [state_dim] + hid_dim * hid_layers + [1]
        self.V = build_net(layers, nn.ReLU, nn.Identity)

    def forward(self, state):
        output = self.V(state)
        return output


INIT_ARGS = {
    'state_dim': 4,
    'hid_dim': [8],
    'hid_layers': 2,
}

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

if __name__ == '__main__':
    model = V_Critic(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
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, 1) — shape (2, 1) 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)
VectorizedCritic Ran
ran on a synthesized input
lemutisme/dr-sac/sac.py
code served (permissive licence) · get_code("89cefec7ee3edbdf")
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, 2) 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 math
import torch
import torch.nn as nn

class VectorizedLinear(nn.Module):

    def __init__(self, in_features: int, out_features: int, ensemble_size: int):
        super().__init__()
        self.in_features = in_features
        self.out_features = out_features
        self.ensemble_size = ensemble_size
        self.weight = nn.Parameter(torch.empty(ensemble_size, in_features, out_features))
        self.bias = nn.Parameter(torch.empty(ensemble_size, 1, out_features))
        self.reset_parameters()

    def reset_parameters(self):
        for layer in range(self.ensemble_size):
            nn.init.kaiming_uniform_(self.weight[layer], a=math.sqrt(5))
        fan_in, _ = nn.init._calculate_fan_in_and_fan_out(self.weight[0])
        bound = 1 / math.sqrt(fan_in) if fan_in > 0 else 0
        nn.init.uniform_(self.bias, -bound, bound)

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        return x @ self.weight + self.bias

class VectorizedCritic(nn.Module):

    def __init__(self, state_dim: int, action_dim: int, hidden_dim: list[int], hid_layers: int, num_critics: int):
        super().__init__()
        layers = [VectorizedLinear(state_dim + action_dim, hidden_dim[0], num_critics), nn.ReLU()]
        for _ in range(hid_layers):
            layers.extend([VectorizedLinear(hidden_dim[0], hidden_dim[0], num_critics), nn.ReLU()])
        layers.append(VectorizedLinear(hidden_dim[0], 1, num_critics))
        self.critic = nn.Sequential(*layers)
        for layer in self.critic[::2]:
            torch.nn.init.constant_(layer.bias, 0.1)
        torch.nn.init.uniform_(self.critic[-1].weight, -0.003, 0.003)
        torch.nn.init.uniform_(self.critic[-1].bias, -0.003, 0.003)
        self.num_critics = num_critics

    def forward(self, state: torch.Tensor, action: torch.Tensor) -> torch.Tensor:
        state_action = torch.cat([state, action], dim=-1)
        state_action = state_action.unsqueeze(0).repeat_interleave(self.num_critics, dim=0)
        q_values = self.critic(state_action).squeeze(-1)
        return q_values

INIT_ARGS = {
    "state_dim": 4,
    "action_dim": 3,
    "hidden_dim": [8],
    "hid_layers": 2,
    "num_critics": 2,
}

ARGS = {
    "state": torch.randn(2, 4),
    "action": torch.randn(2, 3),
}

if __name__ == "__main__":
    model = VectorizedCritic(**INIT_ARGS)
    output = model(**ARGS)
    print("Output shape:", output.shape)
    print("Output:", output)
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, 2) — shape (2, 2) 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)
build_net Ran
ran; our contract draft was wrong, not the code
lemutisme/dr-sac/sac.py
code served (permissive licence) · get_code("eae1a13a0cda9f0e")
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)

# Analyze the function:
# - layer_shape: used in len() and indexing [j] and [j+1], needs to be a sequence of ints
# - hidden_activation: called as hidden_activation() to instantiate, needs to be an nn.Module class
# - output_activation: called as output_activation() to instantiate, needs to be an nn.Module class

ARGS = {
    "layer_shape": [4, 8, 6, 3],
    "hidden_activation": nn.ReLU,
    "output_activation": nn.Sigmoid,
}
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
ConditionalScoreModel Not yet run
unverified (harvested, no recorded run)
lemutisme/dr-sac/sac.py
code served (permissive licence) · get_code("e7338a5540ebf890")
How it ran

no invocation recorded.

ReplayBuffer Not yet run
unverified (harvested, no recorded run)
lemutisme/dr-sac/sac.py
code served (permissive licence) · get_code("45c5e6c336c21050")
How it ran

no invocation recorded.

SAC_continuous Not yet run
unverified (harvested, no recorded run)
lemutisme/dr-sac/sac.py
code served (permissive licence) · get_code("b5f5d1ab656acdad")
How it ran

no invocation recorded.

TransitionDiffusion Not yet run
unverified (harvested, no recorded run)
lemutisme/dr-sac/sac.py
code served (permissive licence) · get_code("8c2dd772be9bbb05")
How it ran

no invocation recorded.

dual Not yet run
unverified (harvested, no recorded run)
lemutisme/dr-sac/sac.py
code served (permissive licence) · get_code("84beae2ea3129aa8")
How it ran

no invocation recorded.

Also present in other papers' code

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

Repositories linked to this paper

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

Abstract

Deep reinforcement learning (RL) has achieved remarkable success, yet its deployment in real-world scenarios is often limited by vulnerability to environmental uncertainties. Distributionally robust RL (DR-RL) algorithms have been proposed to resolve this challenge, but existing approaches are largely restricted to value-based methods in tabular settings. In this work, we introduce Distributionally Robust Soft Actor-Critic (DR-SAC), the first actor-critic based DR-RL algorithm for offline learning in continuous action spaces. DR-SAC maximizes the entropy-regularized rewards against the worst possible transition models within an KL-divergence constrained uncertainty set. We derive the distributionally robust version of the soft policy iteration with a convergence guarantee and incorporate a generative modeling approach to estimate the unknown nominal transition models. Experiment results on five continuous RL tasks demonstrate our algorithm achieves up to 9.8× higher average reward than the SAC baseline under common perturbations. Additionally, DR-SAC significantly improves computing efficiency and applicability to large-scale problems compared with existing DR-RL algorithms. Code is publicly available at https://github.com/Lemutisme/DR-SAC.

For agents

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

get_harvested_code_for_paper("2506.12622")
get_code_for_paper("2506.12622")
have("2506.12622")

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

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

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

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

Connect an agent — have() is free.