SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.11605 · ICML · 2024

Switched Flow Matching: Eliminating Singularities via Switching ODEs

Qunxi Zhu, Wei Lin

arXiv · PDF · Open in the Atlas

Code that ran

12 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 10 failures of our instrument; 4 no recorded run), measured 2026-11-23; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2405.11605.json · badge: /api/ran/2405.11605.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
tensorflow/gan canonical (classifier label)
classifier basis: census
12 ran · 4 no recorded run
FunctionStatusWhere it lives
args_to_gan_model Ran
ran; our contract draft was wrong, not the code
tensorflow/gan/tensorflow_gan/python/losses/tuple_losses.py
code served (permissive licence) · get_code("e00c96eaf4964fcf")
How it ran

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

import torch
import inspect
from collections import namedtuple

torch.manual_seed(0)

# Create a minimal GANModel namedtuple
GANModel = namedtuple('GANModel', ['discriminator_real_outputs', 'discriminator_gen_outputs', 'generator_outputs'])

# Create a simple loss function that takes a GANModel and some optional parameters
def simple_loss(discriminator_real_outputs, discriminator_gen_outputs, generator_outputs=None, weight=1.0):
    """A sample loss function that takes individual arguments."""
    loss = torch.mean(discriminator_real_outputs) + torch.mean(discriminator_gen_outputs)
    if generator_outputs is not None:
        loss = loss + torch.mean(generator_outputs)
    return loss * weight

# Create sample tensors
discriminator_real_outputs = torch.randn(2, 4)
discriminator_gen_outputs = torch.randn(2, 4)
generator_outputs = torch.randn(2, 3)

# Create a GANModel instance
gan_model = GANModel(
    discriminator_real_outputs=discriminator_real_outputs,
    discriminator_gen_outputs=discriminator_gen_outputs,
    generator_outputs=generator_outputs
)

ARGS = {
    'loss_fn': simple_loss,
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_trainable_variables Ran
ran, honoured the contract we drafted
tensorflow/gan/tensorflow_gan/python/contrib_utils.py
code served (permissive licence) · get_code("49e2b0cc4b0c854f")
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, ndim 1, 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 tensorflow as tf

# Enable eager execution and v1 compatibility mode
tf.compat.v1.disable_eager_execution()

# Create a simple TensorFlow graph with some variables
with tf.compat.v1.Graph().as_default():
    with tf.compat.v1.variable_scope("model"):
        # Create some variables in different scopes
        var1 = tf.compat.v1.get_variable("weight", shape=[4, 3], dtype=tf.float32)
        var2 = tf.compat.v1.get_variable("bias", shape=[3], dtype=tf.float32)
    
    with tf.compat.v1.variable_scope("optimizer"):
        var3 = tf.compat.v1.get_variable("learning_rate", shape=[1], dtype=tf.float32)
    
    # Create a session to initialize variables
    with tf.compat.v1.Session() as sess:
        sess.run(tf.compat.v1.global_variables_initializer())

# Define arguments for get_trainable_variables function
ARGS = {
    "scope": None,
    "suffix": None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list 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
get_variables_by_name Ran
ran, honoured the contract we drafted
tensorflow/gan/tensorflow_gan/python/contrib_utils.py
code served (permissive licence) · get_code("bfe05de19b4eb8d1")
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, ndim 1, 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 tensorflow as tf

# Enable TensorFlow 1.x compatibility mode
tf.compat.v1.disable_eager_execution()

# Create a TensorFlow graph and session for variable creation
graph = tf.compat.v1.Graph()
with graph.as_default():
    # Create some test variables in different scopes
    with tf.compat.v1.variable_scope("scope1"):
        var1 = tf.compat.v1.get_variable("my_var", shape=[2, 3])
        var2 = tf.compat.v1.get_variable("other_var", shape=[4, 5])
    
    with tf.compat.v1.variable_scope("scope2"):
        var3 = tf.compat.v1.get_variable("my_var", shape=[3, 4])

# Define arguments for get_variables_by_name function
ARGS = {
    "given_name": "my_var",
    "scope": "scope1"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list 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
image_grid Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tensorflow/gan/tensorflow_gan/python/eval/eval_utils.py
code served (permissive licence) · get_code("c2576a700c35ebba")
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 EagerTensor, ndim 4, dtype family float, shape (1, 64, 96, 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 tensorflow as tf
import numpy as np

# Create a 4D tensor input: batch_size=6, height=32, width=32, channels=3
# Grid shape is [2, 3] so we need 2*3=6 images
batch_size = 6
height = 32
width = 32
num_channels = 3

input_tensor = tf.constant(
    np.random.rand(batch_size, height, width, num_channels).astype(np.float32)
)

grid_shape = [2, 3]
image_shape = [32, 32]

ARGS = {
    'input_tensor': input_tensor,
    'grid_shape': grid_shape,
    'image_shape': image_shape,
    'num_channels': num_channels,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 4, dtype family float, shape (1, 64, 96, 3) — shape (1, 64, 96, 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
kl_divergence Ran
ran; our contract draft was wrong, not the code
tensorflow/gan/tensorflow_gan/python/eval/classifier_metrics.py
code served (permissive licence) · get_code("a3e29c3eb31126b7")
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 SymbolicTensor. 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 tensorflow as tf
import numpy as np

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

# Create small tensors with distinct dimensions
batch_size = 2
num_classes = 4

# p: 2-D floating-point Tensor (batch_size x num_classes)
# Should be a valid probability distribution (sums to 1 along axis 1)
p_values = np.array([
    [0.1, 0.2, 0.3, 0.4],
    [0.25, 0.25, 0.25, 0.25]
], dtype=np.float32)
p = tf.constant(p_values)

# p_logits: 2-D floating-point Tensor (batch_size x num_classes)
# Logits for p (not normalized)
p_logits_values = np.array([
    [0.5, 1.0, 1.5, 2.0],
    [-0.5, 0.0, 0.5, 1.0]
], dtype=np.float32)
p_logits = tf.constant(p_logits_values)

# q: 1-D floating-point Tensor (num_classes,)
# Should be a valid probability distribution (sums to 1)
q_values = np.array([0.1, 0.2, 0.3, 0.4], dtype=np.float32)
q = tf.constant(q_values)

ARGS = {
    'p': p,
    'p_logits': p_logits,
    'q': q
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor 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
python_image_grid Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tensorflow/gan/tensorflow_gan/python/eval/eval_utils.py
code served (permissive licence) · get_code("3c1810a3f62b3156")
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 int, shape (8, 9, 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 numpy as np

# Create a small 4D numpy array for a minibatch of images
# Shape: [batch_size, height, width, num_channels]
# Using batch_size=6, height=4, width=3, num_channels=2
batch_size = 6
height = 4
width = 3
num_channels = 2

input_array = np.random.randint(0, 256, size=(batch_size, height, width, num_channels), dtype=np.uint8)

# Grid shape that matches the batch size: 2 rows x 3 columns = 6 images
grid_shape = [2, 3]

ARGS = {
    'input_array': input_array,
    'grid_shape': grid_shape,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
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 int, shape (8, 9, 2) — shape (8, 9, 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: none by the harness; any seed is in the setup block
run_classifier_fn Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tensorflow/gan/tensorflow_gan/python/eval/classifier_metrics.py
code served (permissive licence) · get_code("c9b8371a08cafd98")
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 SymbolicTensor. 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 tensorflow as tf
import numpy as np

# Create a simple input tensor (batch_size=2, feature_dim=4)
input_tensor = tf.constant(np.random.randn(2, 4).astype(np.float32))

# Create a simple classifier function that takes input and returns outputs
def classifier_fn(x):
    # Simple classifier that returns a single output (batch_size, num_classes=3)
    return tf.keras.layers.Dense(3)(x)

# For single batch case, dtypes can be None
dtypes_single = None

# For multi-batch case, need to specify dtypes matching the output structure
dtypes_multi = tf.float32

ARGS = {
    'input_tensor': input_tensor,
    'classifier_fn': classifier_fn,
    'num_batches': 1,
    'dtypes': dtypes_single,
    'name': 'RunClassifierFn'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor 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
sample_and_run_classifier_fn Ran
ran; our contract draft was wrong, not the code
tensorflow/gan/tensorflow_gan/python/eval/classifier_metrics.py
code served (permissive licence) · get_code("e56d29a30182c70a")
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 EagerTensor, ndim 2, dtype family float, shape (2, 10) 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 tensorflow as tf
import numpy as np

def sample_fn(sample_input):
    """Function that samples images from a distribution"""
    # sample_input is a tensor, return sampled images
    batch_size = tf.shape(sample_input)[0]
    return tf.random.normal([batch_size, 4, 4, 3])

def classifier_fn(images):
    """Function that classifies images"""
    # Takes images tensor and returns classification output
    batch_size = tf.shape(images)[0]
    return tf.random.normal([batch_size, 10])

sample_inputs = [
    tf.constant(np.random.randn(2, 8).astype(np.float32)),
]

ARGS = {
    'sample_fn': sample_fn,
    'sample_inputs': sample_inputs,
    'classifier_fn': classifier_fn,
    'dtypes': None,
    'name': 'SampleAndRunClassifierFn'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 2, dtype family float, shape (2, 10) — shape (2, 10) 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
stargan_prediction_input_fn_wrapper Ran
ran; our contract draft was wrong, not the code
tensorflow/gan/tensorflow_gan/python/estimator/stargan_estimator.py
code served (permissive licence) · get_code("86ee4730f89c1466")
How it ran

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

import torch
import torch.nn as nn
import numpy as np

# Define a simple input function that returns (feature, label) tuple
def simple_input_fn():
    # Create sample features and labels for StarGAN
    features = {
        'image': torch.randn(2, 3, 4, 4),  # batch_size=2, channels=3, height=4, width=4
        'domain': torch.randint(0, 2, (2,))  # batch_size=2, domain labels
    }
    labels = torch.randint(0, 2, (2,))  # batch_size=2 labels
    return (features, labels)

ARGS = {
    'fn': simple_input_fn
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
wasserstein_discriminator_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tensorflow/gan/tensorflow_gan/python/losses/losses_impl.py
code served (permissive licence) · get_code("6dfacdb4f7f296a6")
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 SymbolicTensor. 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 tensorflow as tf

# Set random seed for reproducibility
tf.compat.v1.set_random_seed(0)

# Create small discriminator output tensors
# Batch size: 2, output dimension: 1 (discriminator typically outputs scalars)
batch_size = 2
output_dim = 1

discriminator_real_outputs = tf.constant(
    [[0.5], [0.3]], dtype=tf.float32
)

discriminator_gen_outputs = tf.constant(
    [[-0.4], [-0.2]], dtype=tf.float32
)

# Weights can be scalars or tensors matching the shape of outputs
real_weights = 1.0
generated_weights = 1.0

# Scope name for the operation
scope = "wasserstein_discriminator_loss_scope"

# Loss collection (using default TensorFlow collections)
loss_collection = tf.compat.v1.GraphKeys.LOSSES

# Reduction type
reduction = tf.compat.v1.losses.Reduction.SUM_BY_NONZERO_WEIGHTS

# Whether to add summaries
add_summaries = False

ARGS = {
    "discriminator_real_outputs": discriminator_real_outputs,
    "discriminator_gen_outputs": discriminator_gen_outputs,
    "real_weights": real_weights,
    "generated_weights": generated_weights,
    "scope": scope,
    "loss_collection": loss_collection,
    "reduction": reduction,
    "add_summaries": add_summaries,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor 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
wasserstein_generator_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tensorflow/gan/tensorflow_gan/python/losses/losses_impl.py
code served (permissive licence) · get_code("ef511aaa7c479fd0")
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 SymbolicTensor. 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 tensorflow as tf
import numpy as np

# Create a small discriminator output tensor
# Shape: (batch_size=2, features=4)
discriminator_gen_outputs = tf.constant(
    [[0.5, -0.3, 0.2, 0.1],
     [0.4, 0.1, -0.2, 0.3]],
    dtype=tf.float32
)

# Create weights tensor with same rank as discriminator_gen_outputs
weights = tf.constant(
    [[1.0, 1.0, 1.0, 1.0],
     [1.0, 1.0, 1.0, 1.0]],
    dtype=tf.float32
)

# Build ARGS dictionary with all parameters
ARGS = {
    'discriminator_gen_outputs': discriminator_gen_outputs,
    'weights': weights,
    'scope': None,
    'loss_collection': tf.compat.v1.GraphKeys.LOSSES,
    'reduction': tf.compat.v1.losses.Reduction.SUM_BY_NONZERO_WEIGHTS,
    'add_summaries': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor 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
wasserstein_hinge_discriminator_loss Ran
ran; our contract draft was wrong, not the code
tensorflow/gan/tensorflow_gan/python/losses/losses_impl.py
code served (permissive licence) · get_code("3160840ade588e25")
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 SymbolicTensor. 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 tensorflow as tf

tf.compat.v1.disable_eager_execution()

# Create small tensors for discriminator outputs
# batch_size=2, output_dim=4
discriminator_real_outputs = tf.constant([[0.5, 1.2, -0.3, 0.8],
                                          [1.1, 0.2, 0.9, -0.4]], dtype=tf.float32)

discriminator_gen_outputs = tf.constant([[-0.2, 0.8, 1.5, 0.1],
                                         [0.3, -0.5, 0.7, 1.2]], dtype=tf.float32)

# Real and generated weights - can be scalar or tensor
real_weights = 1.0
generated_weights = 1.0

# Hinge parameters
real_hinge = 1.0
generated_hinge = 1.0

# Scope for the operations
scope = None

# Loss collection
loss_collection = tf.compat.v1.GraphKeys.LOSSES

# Reduction strategy
reduction = tf.compat.v1.losses.Reduction.SUM_BY_NONZERO_WEIGHTS

# Whether to add summaries
add_summaries = False

ARGS = {
    'discriminator_real_outputs': discriminator_real_outputs,
    'discriminator_gen_outputs': discriminator_gen_outputs,
    'real_weights': real_weights,
    'generated_weights': generated_weights,
    'real_hinge': real_hinge,
    'generated_hinge': generated_hinge,
    'scope': scope,
    'loss_collection': loss_collection,
    'reduction': reduction,
    'add_summaries': add_summaries,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor 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
discriminator_fn Not yet run
unverified (harvested, no recorded run)
tensorflow/gan/tensorflow_gan/python/estimator/tpu_gan_estimator_test_lib.py
code served (permissive licence) · get_code("1341ccc8c51a764e")
How it ran

no invocation recorded.

generator_fn Not yet run
unverified (harvested, no recorded run)
tensorflow/gan/tensorflow_gan/python/estimator/tpu_gan_estimator_test_lib.py
code served (permissive licence) · get_code("ace1970711646371")
How it ran

no invocation recorded.

get_variables Not yet run
unverified (harvested, no recorded run)
tensorflow/gan/tensorflow_gan/python/contrib_utils.py
code served (permissive licence) · get_code("8257e435f9a8eec2")
How it ran

no invocation recorded.

image_reshaper Not yet run
unverified (harvested, no recorded run)
tensorflow/gan/tensorflow_gan/python/eval/eval_utils.py
code served (permissive licence) · get_code("1ea274c92e014f1e")
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, 15 are also present in other papers whose code we hold (15 with at least one paper dated earlier, 0 the same month, 0 later) and 1 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
discriminator_fn 1 other paper
1 dated earlier
1805.08318 (2018-05)
Self-Attention Generative Adversarial Networks
generator_fn 1 other paper
1 dated earlier
1805.08318 (2018-05)
Self-Attention Generative Adversarial Networks
get_trainable_variables 1 other paper
1 dated earlier
1805.08318 (2018-05)
Self-Attention Generative Adversarial Networks
get_variables 1 other paper
1 dated earlier
1805.08318 (2018-05)
Self-Attention Generative Adversarial Networks
get_variables_by_name 1 other paper
1 dated earlier
1805.08318 (2018-05)
Self-Attention Generative Adversarial Networks
image_grid 1 other paper
1 dated earlier
1805.08318 (2018-05)
Self-Attention Generative Adversarial Networks
image_reshaper 1 other paper
1 dated earlier
1805.08318 (2018-05)
Self-Attention Generative Adversarial Networks
kl_divergence 1 other paper
1 dated earlier
1805.08318 (2018-05)
Self-Attention Generative Adversarial Networks
python_image_grid 1 other paper
1 dated earlier
1805.08318 (2018-05)
Self-Attention Generative Adversarial Networks
run_classifier_fn 1 other paper
1 dated earlier
1805.08318 (2018-05)
Self-Attention Generative Adversarial Networks
sample_and_run_classifier_fn 1 other paper
1 dated earlier
1805.08318 (2018-05)
Self-Attention Generative Adversarial Networks
stargan_prediction_input_fn_wrapper 1 other paper
1 dated earlier
1805.08318 (2018-05)
Self-Attention Generative Adversarial Networks
wasserstein_discriminator_loss 1 other paper
1 dated earlier
1805.08318 (2018-05)
Self-Attention Generative Adversarial Networks
wasserstein_generator_loss 1 other paper
1 dated earlier
1805.08318 (2018-05)
Self-Attention Generative Adversarial Networks
wasserstein_hinge_discriminator_loss 1 other paper
1 dated earlier
1805.08318 (2018-05)
Self-Attention Generative Adversarial Networks

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

Repositories linked to this paper

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

Abstract

Continuous-time generative models, such as Flow Matching (FM), construct probability paths to transport between one distribution and another through the simulation-free learning of the neural ordinary differential equations (ODEs). During inference, however, the learned model often requires multiple neural network evaluations to accurately integrate the flow, resulting in a slow sampling speed. We attribute the reason to the inherent (joint) heterogeneity of source and/or target distributions, namely the singularity problem, which poses challenges for training the neural ODEs effectively. To address this issue, we propose a more general framework, termed Switched FM (SFM), that eliminates singularities via switching ODEs, as opposed to using a uniform ODE in FM. Importantly, we theoretically show that FM cannot transport between two simple distributions due to the existence and uniqueness of initial value problems of ODEs, while these limitations can be well tackled by SFM. From an orthogonal perspective, our framework can seamlessly integrate with the existing advanced techniques, such as minibatch optimal transport, to further enhance the straightness of the flow, yielding a more efficient sampling process with reduced costs. We demonstrate the effectiveness of the newly proposed SFM through several numerical examples.

For agents

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

get_harvested_code_for_paper("2405.11605")
get_code_for_paper("2405.11605")
have("2405.11605")

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

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

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

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

Connect an agent — have() is free.