SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1907.05321 · 2019

Time2Vec: Learning a Vector Representation of Time

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 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 6 have no contract verdict; 1 failure of our instrument; 0 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/1907.05321.json · badge: /api/ran/1907.05321.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
eyangs/transferNILM community (classifier label)
classifier basis not recorded on the link
5 ran · 0 no recorded run
email81227/Time2Vec-TensorFlow2 community (classifier label)
classifier basis not recorded on the link
1 ran · 0 no recorded run
ojus1/Time2Vec-PyTorch reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
general_lstm Ran
ran on a synthesized input
email81227/Time2Vec-TensorFlow2/Time2Vec/models.py
code served (permissive licence) · get_code("0938fbba8de62928")
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 Functional. 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
from tensorflow.keras import layers, Model

def general_lstm(dim):
    inp = layers.Input(shape=(dim, 1))
    x = layers.LSTM(32)(inp)
    x = layers.Dense(1)(x)
    m = Model(inp, x)
    return m

ARGS = {
    "dim": 4
}
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 Functional — a Functional output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Functional 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_FN Ran
ran on a synthesized input
eyangs/transferNILM/nilm_metric.py
code served (permissive licence) · get_code("376ce8b641e072e3")
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 float64, ndim 0, 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 numpy as np

# Create small numpy arrays for target and prediction
# The function expects binary or probability-like values
target = np.array([
    [0.1, 0.9, 0.2, 0.8],
    [0.3, 0.7, 0.4, 0.6]
], dtype=np.float32)

prediction = np.array([
    [0.15, 0.85, 0.25, 0.75],
    [0.35, 0.65, 0.45, 0.55]
], dtype=np.float32)

threshold = 0.5

ARGS = {
    "target": target,
    "prediction": prediction,
    "threshold": threshold
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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_FP Ran
ran on a synthesized input
eyangs/transferNILM/nilm_metric.py
code served (permissive licence) · get_code("3296b6a7c143557f")
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 float64, ndim 0, 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 numpy as np

# Create sample target and prediction arrays
np.random.seed(0)
target = np.random.rand(4, 5).astype(np.float32)
prediction = np.random.rand(4, 5).astype(np.float32)
threshold = 0.5

ARGS = {
    "target": target,
    "prediction": prediction,
    "threshold": threshold
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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_TP Ran
ran on a synthesized input
eyangs/transferNILM/nilm_metric.py
code served (permissive licence) · get_code("567d6001f05c80ee")
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 float64, ndim 0, 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 numpy as np

# Create sample target and prediction arrays
# These are binary-like arrays where values will be clipped and transformed
target = np.array([0.5, 0.2, 0.8, 0.1, 0.9, 0.3])
prediction = np.array([0.6, 0.1, 0.7, 0.2, 0.85, 0.4])

# Define threshold
threshold = 0.5

ARGS = {
    "target": target,
    "prediction": prediction,
    "threshold": threshold
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
load_dataframe Ran
ran on a synthesized input
eyangs/transferNILM/dataset_management/functions.py
code served (permissive licence) · get_code("82a028fb3cb5f091")
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 DataFrame. 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 pandas as pd
import tempfile
import os

# Create a temporary directory structure and file to simulate the data source
temp_dir = tempfile.mkdtemp()
building_dir = os.path.join(temp_dir, 'house_1')
os.makedirs(building_dir, exist_ok=True)

# Create a sample .dat file with tab-separated values
channel_file = os.path.join(building_dir, 'channel_5.dat')
with open(channel_file, 'w') as f:
    f.write("1000\t25.5\n")
    f.write("1001\t26.3\n")
    f.write("1002\t25.8\n")

ARGS = {
    'directory': temp_dir + '/',
    'building': 1,
    'channel': 5,
    'col_names': ['time', 'data'],
    'nrows': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
seq2point Ran
ran on a synthesized input
eyangs/transferNILM/model_structure.py
code served (permissive licence) · get_code("fa3722ff1a8f007b")
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 Functional. 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

# The function seq2point takes a single parameter: input_window_length
# which is an integer specifying the length of the input window for the seq2point model

ARGS = {
    "input_window_length": 100
}
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 Functional — a Functional output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Functional 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
t2v Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ojus1/Time2Vec-PyTorch/periodic_activations.py
code served (permissive licence) · get_code("e4bdfc21bb19cabb")
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) and returned Tensor, ndim 2, dtype family float, shape (2, 8) 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

torch.manual_seed(0)

# tau: input tensor, shape (batch, in_features)
tau = torch.randn(2, 4)

# f: a callable that takes a tensor and optionally an arg
class SimpleActivation(nn.Module):
    def forward(self, x, arg=None):
        if arg is not None:
            return torch.relu(x) * arg
        return torch.relu(x)

f = SimpleActivation()

# out_features: output feature dimension
out_features = 5

# w: weight matrix for first transformation, shape (in_features, hidden_features)
w = torch.randn(4, 3)

# b: bias for first transformation, shape (hidden_features,)
b = torch.randn(3)

# w0: weight matrix for second transformation, shape (in_features, out_features)
w0 = torch.randn(4, 5)

# b0: bias for second transformation, shape (out_features,)
b0 = torch.randn(5)

# arg: optional argument to pass to f
arg = torch.tensor(2.0)

ARGS = {
    "tau": tau,
    "f": f,
    "out_features": out_features,
    "w": w,
    "b": b,
    "w0": w0,
    "b0": b0,
    "arg": arg,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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, 8) — shape (2, 8) 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

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 6 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
t2v 1 other paper
1 later
2310.04486 (2023-10)
T-Rep: Representation Learning for Time Series using Time-Embeddings

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

Time is an important feature in many applications involving events that occur synchronously and/or asynchronously. To effectively consume time information, recent studies have focused on designing new architectures. In this paper, we take an orthogonal but complementary approach by providing a model-agnostic vector representation for time, called Time2Vec, that can be easily imported into many existing and future architectures and improve their performances. We show on a range of models and problems that replacing the notion of time with its Time2Vec representation improves the performance of the final model.

For agents

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

get_harvested_code_for_paper("1907.05321")
get_code_for_paper("1907.05321")
have("1907.05321")

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

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

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

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

Connect an agent — have() is free.