TimeGANGenerator<T>

Models & Types · AiDotNet.NeuralNetworks.SyntheticData

TimeGAN generator for synthesizing realistic time-series tabular data while preserving temporal dynamics using an embedding-supervisor-adversarial training framework.

Inheritance: NeuralNetworkBase<T> → NeuralSyntheticTabularGeneratorBase<T> → TimeGANGenerator<T>

Implements: ISyntheticTabularGenerator<T>

For Beginners

TimeGAN works by:

  1. Learning to compress time-series into a simpler space (embedding)
  2. Learning how data moves through time in that space (supervisor)
  3. Learning to generate realistic fake data using both spatial and temporal info

Example usage:

How It Works

TimeGAN uses five jointly trained components in a shared latent space:

Training has three phases:

  1. Embedding phase: Train embedder + recovery to reconstruct data
  2. Supervised phase: Train supervisor to predict next-step embeddings
  3. Joint phase: Train all 5 components together with combined losses

This implementation follows the standard neural network architecture pattern with:

  • Proper inheritance from NeuralNetworkBase
  • Layers = generator network (user-overridable via Architecture)
  • Auxiliary networks (embedder, recovery, supervisor, discriminator) are internal

Reference: “Time-series Generative Adversarial Networks” (Yoon et al., NeurIPS 2019)

Constructors

Constructor Summary
TimeGANGenerator() Initializes a new TimeGAN generator with the specified architecture.
TimeGANGenerator(NeuralNetworkArchitecture<T> architecture, TimeGANOptions<T> options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer, ILossFunction<T> lossFunction)

Properties

Property Summary
IReadOnlyList<ColumnMetadata> Columns { get; }
TimeGANOptions<T> TimeGanOptions { get; } Gets the TimeGAN-specific options.
bool IsFitted { get; set; }

Methods

Method Summary
Dictionary<string, T> GetFeatureImportance()
Dictionary<string, Tensor<T>> GetNamedLayerActivations(Tensor<T> input) Reports the three stages of the synthesis path: generator, supervisor and recovery.
Matrix<T> Generate(int numSamples, Vector<T> conditionColumn, Vector<T> conditionValue)
ModelMetadata<T> GetModelMetadata()
Task FitAsync(Matrix<T> data, IReadOnlyList<ColumnMetadata> columns, int? epochs, CancellationToken ct)
void Fit(Matrix<T> data, IReadOnlyList<ColumnMetadata> columns, int? epochs)