Skip to main content

TimeDiffusion - Unified Framework for Multiple Time Series Tasks

Project description

TimeDiffusion - Unified Framework for Multiple Time Series Tasks

Supports 2D (image) and 3D (video) data as input for research purposes.

Install

pip install timediffusion

Quick Start

Forecasting time series

# train sequence in shape [channels, sequence_length]
model = TD(input_dims=train.shape).to(device=device)
training_losses = model.fit(train)
# horizon : int - how many future values to forecast
predictions = model.forecast(horizon)

Creating synthetic time series

# sequence in shape [channels, sequence_length]
model = TD(input_dims=seq.shape).to(device=device)
training_losses = model.fit(seq)
# proximity - how close to original, samples - total synthetic time series
synthetic_data = model.synth(proximity=0.9, samples=3, batch_size=2, step_granulation=10)

Time series Imputation

# sequence in shape [channels, sequence_length]
model = TD(input_dims=seq.shape).to(device=device)
# mask - binary array of same shape, as sequence, with 1 in positions, that are unknown
training_losses = model.fit(seq, mask=mask)
restored_seq = model.restore(example=seq, mask=mask)

Examples

Time series: multiple tasks example

Forecasting bitcoin price example

Philosophy

Main synopsis behind TimeDiffusion model is that in reality, when working with time series we don’t have many samples, as it could be in other machine learning fields (e.g. cv, nlp). Thus, classical autoregressive approaches like ARIMA has the most suitable approach of fitting / training only on original sequence (maybe with some exogenous data).

TimeDiffusion takes inspiration from these established methods and only trains on the input sample. Model incorporates most powerful modern deep learning techniques such as diffusion process, exponential dilated convolutions, residual connections and attention mechanism (in one of the versions)

Model architecture

Presented below are diagrams depicting model components, each new scheme representing a higher level of abstraction.

  • Temporal Block

Temporal Block Architecture image

  • TimeDiffusionProjector (currently main model in use)

TimeDiffusionProjector Architecture image

  • TimeDiffusionAttention (currently not viable)

TimeDiffusion Architecture image

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

timediffusion-0.3.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

timediffusion-0.3-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file timediffusion-0.3.tar.gz.

File metadata

  • Download URL: timediffusion-0.3.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for timediffusion-0.3.tar.gz
Algorithm Hash digest
SHA256 db6889f2a8d2c9d32fd9f2fab3d8eb6da955a5ede76d47cf1d4083d719410962
MD5 7280696021f9fb659d39a24a235d5439
BLAKE2b-256 8053d8cfddac23901b18fd341ed2d10358ed97711f38ee20f26129684190385b

See more details on using hashes here.

File details

Details for the file timediffusion-0.3-py3-none-any.whl.

File metadata

  • Download URL: timediffusion-0.3-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for timediffusion-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 282a6e1002c360ee52f91fe4b6eeff1fe490f6616cb7e412b957e856a1fec980
MD5 a7c8c9863188266ebe660c7bbc4e57f2
BLAKE2b-256 2ee0502bea56c554e49600ea9e5a1e40cc8772df43f4291b4218b576742f9609

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page