Git Product home page Git Product logo

tsgm's Introduction

unit-tests Python 3.8+ License

Time Series Generative Modeling Framework (TSGM)

Documentation | Tutorials

About TSGM

TSGM is an open-source framework for synthetic time series generation.

The framework can be used for:

  • creating synthetic data, using historical data, black-box models, or a combined approach,
  • researching new approaches for synthetic data generation,
  • comparison of different generative methods for time series.

Getting started

We provide:

  • Documentation where we give complete overview of the implemented methods,
  • Tutorials with tutorials that describe practical use-cases of the framework.

Install TSGM

For contributors

git clone github.com/AlexanderVNikitin/tsgm
cd tsgm
make install

Run tests:

make test

To check static typing:

mypy

CLI

We provide two CLIs for convenient synthetic data generation:

  • tsgm-gd generates data by a stored sample,
  • tsgm-eval evaluates the generated time series.

Use tsgm-gd --help or tsgm-eval --help for documentation.

Train your generative model

Here, we provide the gist of the framework, for the completed examples see our tutorials.

import tsgm

# ... Define hyperparameters ...
# dataset is a tensor of shape n_samples x seq_len x feature_dim

# Zoo contains several prebuilt architectures: we choose a conditional GAN architecture
architecture = tsgm.models.architectures.zoo["cgan_base_c4_l1"](
    seq_len=seq_len, feat_dim=feature_dim,
    latent_dim=latent_dim, output_dim=0)
discriminator, generator = architecture.discriminator, architecture.generator

# Initialize GAN object with selected discriminator and generator
gan = tsgm.models.cgan.GAN(
    discriminator=discriminator, generator=generator, latent_dim=latent_dim
)
gan.compile(
    d_optimizer=keras.optimizers.Adam(learning_rate=0.0003),
    g_optimizer=keras.optimizers.Adam(learning_rate=0.0003),
    loss_fn=keras.losses.BinaryCrossentropy(from_logits=True),
)
gan.fit(dataset, epochs=N_EPOCHS)

# Generate 100 synthetic samples
result = gan.generate(100)

Datasets

TSGM provides API for convenient use of many time-series datasets. The comprehensive list of the datasets in the documentation

Contributing

We appreciate all contributions. To learn more, please check CONTRIBUTING.md.

License

Apache License 2.0

tsgm's People

Contributors

alexandervnikitin avatar letiziaia avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.