diff --git a/README.md b/README.md index 6499bb3..8e6fbce 100644 --- a/README.md +++ b/README.md @@ -93,10 +93,14 @@ result = gan.generate(100) ## :anchor: Tutorials -- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1l2VB6eUwvrxyu8iB30faGiQM5AKthc82?usp=sharing) Introductory Tutorial "[Getting started with TSGM](https://github.com/AlexanderVNikitin/tsgm/blob/main/tutorials/GANs/cGAN.ipynb)" -- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1Vw9t4TlI1Nek_t6bMPyKcPPPqCiXfOK3?usp=sharing) Tutorial on using [Time Series Augmentations](https://github.com/AlexanderVNikitin/tsgm/blob/main/tutorials/augmentations.ipynb) -- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1hubtddSX94KyLzuCTwmU6pAFBgBeiEB-?usp=sharing) Tutorial on [Evaluation of Synthetic Time Series Data](https://github.com/AlexanderVNikitin/tsgm/blob/main/tutorials/evaluation.ipynb) -- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1wpf9WeNVj5TkUcPF6EavVx-hUCOfyvUd?usp=sharing) Tutorial on using [Multiple GPUs or TPU with TSGM](https://github.com/AlexanderVNikitin/tsgm/blob/main/tutorials/Using%20Multiple%20GPUs%20or%20TPU.ipynb) +- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1l2VB6eUwvrxyu8iB30faGiQM5AKthc82?usp=sharing) Introductory Tutorial [Getting started with TSGM](https://github.com/AlexanderVNikitin/tsgm/blob/main/tutorials/GANs/cGAN.ipynb) +- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1frSnJQSsuPS3asgIkmcrNtX4Y7TIQI56?usp=sharing) Tutorial [Datasets in TSGM](https://github.com/AlexanderVNikitin/tsgm/blob/main/tutorials/Datasets.ipynb) +- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1Vw9t4TlI1Nek_t6bMPyKcPPPqCiXfOK3?usp=sharing) Tutorial [Time Series Augmentations](https://github.com/AlexanderVNikitin/tsgm/blob/main/tutorials/augmentations.ipynb) +- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1_jpGrPcwoSpB8eii8XW-spaikczdPqIQ?usp=sharing) Tutorial [Time Series Generation with VAEs](https://github.com/AlexanderVNikitin/tsgm/blob/main/tutorials/VAEs/VAE.ipynb) +- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1rcN3pr8uglBEEOo4bTa1fvXgSMx1vKq9?usp=sharing) Tutorial [Conditional Time Series Generation with GANs](https://github.com/AlexanderVNikitin/tsgm/blob/main/tutorials/GANs/cGAN.ipynb) +- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1hubtddSX94KyLzuCTwmU6pAFBgBeiEB-?usp=sharing) Tutorial [Evaluation of Synthetic Time Series Data](https://github.com/AlexanderVNikitin/tsgm/blob/main/tutorials/evaluation.ipynb) +- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1SKD9hRi-ic27Wts9Qzkssjfe1z7o1NU4?usp=sharing) Tutorial [Model Selection](https://github.com/AlexanderVNikitin/tsgm/blob/main/tutorials/Model%20Selection.ipynb) +- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1wpf9WeNVj5TkUcPF6EavVx-hUCOfyvUd?usp=sharing) Tutorial [Multiple GPUs or TPU with TSGM](https://github.com/AlexanderVNikitin/tsgm/blob/main/tutorials/Using%20Multiple%20GPUs%20or%20TPU.ipynb) For more examples, see [our tutorials](./tutorials). diff --git a/tutorials/GANs/cGAN.ipynb b/tutorials/GANs/cGAN.ipynb index 8f41078..c074697 100644 --- a/tutorials/GANs/cGAN.ipynb +++ b/tutorials/GANs/cGAN.ipynb @@ -1,5 +1,14 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "fd5a3eaf", + "metadata": {}, + "source": [ + "# Conditional Time Series Generation with GANs\n", + "This tutorial covers the generation of a temporal dataset where each time series has a class label assigned." + ] + }, { "cell_type": "code", "execution_count": null, @@ -12,16 +21,8 @@ "\n", "import numpy as np\n", "\n", - "import matplotlib.pyplot as plt" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "10e3e196", - "metadata": {}, - "outputs": [], - "source": [ + "import matplotlib.pyplot as plt\n", + "\n", "from tensorflow import keras\n", "from tensorflow.keras import layers\n", "\n", @@ -35,12 +36,12 @@ "id": "843de5f0", "metadata": {}, "source": [ - "We want to generate a temporal dataset where each time series belongs to one of two classes. Let's go step by step through the solution.\n", + "We aim to generate a temporal dataset where each time series belongs to one of two classes. Let's go through the solution step by step.\n", "\n", "#### 1. Define parameters of GAN:\n", - "First, we are defining the parameters of GAN, and the training algorithm.\n", - "- `latent_dim` is the size of input noise in GAN,\n", - "- `output_dim` is the number of classes, which, mentioned above is two,\n", + "First, we need to define the parameters for the Generative Adversarial Network (GAN) and its training algorithm:\n", + "- `latent_dim` is the size of the input noise in GAN,\n", + "- `output_dim` is the number of output classes, which in this case is two.,\n", "- `feature_dim` is the number of time series features,\n", "- `seq_len` is the length of the time series." ] @@ -69,7 +70,7 @@ "metadata": {}, "source": [ "#### 2. Load data:\n", - "We are working with a toy dataset, and use `tsgm` utility called `tsgm.utils.gen_sine_vs_const_dataset` to generate the data. Next, we featurewise scale the dataset so that each feature is in $[-1, 1]$, using `tsgm.utils.TSFeatureWiseScaler`." + "We will generate a toy dataset, and use `tsgm` utility called `tsgm.utils.gen_sine_vs_const_dataset` to generate the data. After generating the data, we will scale each feature to be within the range of $[-1, 1]$, using `tsgm.utils.TSFeatureWiseScaler`." ] }, { @@ -98,7 +99,7 @@ "metadata": {}, "source": [ "#### 3. Visually explore the dataset.\n", - "There are many tools for convenient visualizations of temporal datasets. Here, we use `tsgm.utils.visualize_ts_lineplot`, which is convenient for TS classification datasets." + "There are many tools for convenient visualizations of temporal datasets in `tsgm,utils`. Here, we use `tsgm.utils.visualize_ts_lineplot`, which is convenient for TS classification datasets." ] }, { @@ -119,7 +120,7 @@ "metadata": {}, "source": [ "#### 4. Choose architecture.\n", - "Here, you can either use one of the architectures presented in `tsgm.models.architectures`, or define custom discriminator and generator architectures as `tf` models." + "Here, one can either use one of the architectures presented in `tsgm.models.architectures`, or define custom discriminator and generator architectures as `keras` models." ] }, { @@ -141,7 +142,7 @@ "metadata": {}, "source": [ "#### 5. Define model and train it.\n", - "We define conditional GAN model (`tsgm.models.cgan.ConditionalGAN`), compile it (here, you can choose different optimizers for discriminator and generator), and train using `.fit` model. Additionally, we use `tsgm.models.monitors.GANMonitor` to track training process." + "We define a conditional GAN model (`tsgm.models.cgan.ConditionalGAN`), compile it (here, one can choose different optimizers for discriminator and generator), and train using `.fit` model. Additionally, we employ `tsgm.models.monitors.GANMonitor` to monitor and track the training process, ensuring we can observe the model's progress and performance." ] }, { diff --git a/tutorials/VAEs/VAE.ipynb b/tutorials/VAEs/VAE.ipynb index fa12c9a..d0acc7d 100644 --- a/tutorials/VAEs/VAE.ipynb +++ b/tutorials/VAEs/VAE.ipynb @@ -5,7 +5,7 @@ "id": "60611bed", "metadata": {}, "source": [ - "## Time series generation using VAEs.\n", + "# Time series generation using VAEs\n", "This is a minimal example of unsupervised time series generation using VAEs." ] }, @@ -36,7 +36,7 @@ "metadata": {}, "source": [ "#### 1. Choose architecture of encoder and decoder.\n", - "Here, you can either use one of the architectures presented in `tsgm.models.architectures`, or define custom discriminator and generator architectures as `tf` models." + "Here, you can either use one of the architectures presented in `tsgm.models.architectures`, or define custom discriminator and generator architectures as `keras` models." ] }, { @@ -56,7 +56,7 @@ "metadata": {}, "source": [ "#### 2. Load data:\n", - "We are working with a toy dataset, and use `tsgm` utility called `tsgm.utils.gen_sine_dataset` to generate the data. Next, we featurewise scale the dataset so that each feature is in $[0, 1]$, using `tsgm.utils.TSFeatureWiseScaler`." + "We are working with a toy dataset, and use `tsgm` utility called `tsgm.utils.gen_sine_dataset` to generate the data. Next, we feature-wise scale the dataset so that each feature is in $[0, 1]$, using `tsgm.utils.TSFeatureWiseScaler`." ] }, { @@ -77,7 +77,7 @@ "metadata": {}, "source": [ "#### 3. Define model and train it.\n", - "We define conditional GAN model (`tsgm.models.cvae.BetaVAE`), compile it, and train using `.fit` model. Additionally, we use `tsgm.models.monitors.GANMonitor` to track training process." + "We define a conditional GAN model (`tsgm.models.cvae.BetaVAE`), compile it, and train using `.fit` model." ] }, { @@ -99,7 +99,7 @@ "metadata": {}, "source": [ "#### 4. Check reconstruction of the data.\n", - "We reconstruct data using `vae.predict(scaled_data)`. For validating that VAE works, we check that original and reconstructed datasets are visually similar using `tsgm.utils.visualize_original_and_reconst_ts`." + "We reconstruct data using `vae.predict(scaled_data)`. For validating that VAE works, we check that the original and reconstructed datasets are visually similar using `tsgm.utils.visualize_original_and_reconst_ts`." ] }, {