tsgm.models.cvae

Module Contents

class BetaVAE(encoder: tensorflow.keras.Model, decoder: tensorflow.keras.Model, beta: float = 1.0, **kwargs)[source]

Bases: tensorflow.keras.Model

beta-VAE implementation for unlabeled time series.

Parameters:
  • encoder (keras.Model) – An encoder model which takes a time series as input and check whether the image is real or fake.

  • decoder (keras.Model) – Takes as input a random noise vector of latent_dim length and returns a simulated time-series.

  • latent_dim (int) – The size of the noise vector.

property metrics: List[source]
Returns:

A list of metrics trackers (e.g., generator’s loss and discriminator’s loss).

call(X: tsgm.types.Tensor) tsgm.types.Tensor[source]

Encodes and decodes time series dataset X.

Parameters:

X (tsgm.types.Tensor) – The size of the noise vector.

Returns:

Generated samples

Return type:

tsgm.types.Tensor

train_step(data: tsgm.types.Tensor) Dict[source]

Performs a training step using a batch of data, stored in data.

Parameters:

data (tsgm.types.Tensor) – A batch of data in a format batch_size x seq_len x feat_dim

Returns:

A dict with losses

Return type:

T.Dict

generate(n: int) tsgm.types.Tensor[source]

Generates new data from the model.

Parameters:

n (int) – the number of samples to be generated.

Returns:

A tensor with generated samples.

Return type:

tsgm.types.Tensor