TimeBridge

February 6, 2026 ยท View on GitHub

Official Pytorch Implementation of "TimeBridge: Better Diffusion Prior Design with Bridge Models for Time Series Generation" (KDD 2026)

Code Implementation

For code implementation, we use the official code of Diffusion-TS (ICLR 24), including dataset and running code.

Dataset

All the four real-world datasets (Stocks, ETTh1, Energy and fMRI) can be obtained from Google Drive. Please download dataset.zip, then unzip and copy it to the folder ./Data in our repository. EEG dataset can be downloaded from here and should also be placed in the aforementioned ./Data/dataset folder.

Environment & Libraries

The full libraries list is provided as a requirements.txt in this repo. Please create a virtual environment with conda or venv and run

(myenv) $ pip install -r requirements.txt

Training & Sampling

Note: We provide .yaml config files (stock, sines, mujoco, etth, energy, fmri) under ./Config folder.


Common Parameters

ParameterDescriptionOptions/Values
--dataDataset nameenergy, etth, fmri, mujoco, sines, stock
--nameExperiment nameCustom string
--outputOutput directoryDefault: OUTPUT
--sampleTask type0: unconditional, 1: conditional
--modeTask modegeneration, infill

TimeBridge Parameters

ParameterDescriptionNotes
--priorPrior distributionnormal, uniform, trend, trend-poly, trend-linear, gp
--pred_modePrediction modevp or ve. Important: vp requires sigma_max=1.0
--samplerSampling methodsde or ode
--sigma_minMin noise levelDiffusion noise parameter
--sigma_maxMax noise levelMust be 1.0 for vp mode
--sigma_dataData noise scaleDiffusion noise parameter
--beta_minBeta schedule minBeta schedule parameter
--beta_dBeta schedule maxBeta schedule parameter
--kernel_typeGP kernel typeFor GP prior
--bwBandwidth typeFor GP prior
--varPrior varianceVariance parameter
--model_matchingMatching typeModel matching strategy

Usage Examples

Refer to run folder for example notebooks including best settings (01_Unconditional_Generation.ipynb, etc.).

1. Unconditional Generation

01_Unconditional_Generation.ipynb

2. Trend Priors (Trend-Conditional Generation)

02_Conditional_Generation.ipynb

Using different trend-based priors: --prior [trend-poly, trend-linear, trend]

Using conditional embedding: --cond_embedding

3. Imputation (Fixed-data Conditional)

03_Imputation_energy.ipynb

For missing value imputation: --prior [impt-linear, impt-quadratic]

Acknowledgement

Our code is based on the Diffusion-TS (ICLR 24) and DDBM (ICLR 24) below.

  1. Diffusion-TS: https://github.com/Y-debug-sys/Diffusion-TS
  2. DDBM: https://github.com/alexzhou907/DDBM