ttslearn.train_util

Specific utilities for training

Dataset

class ttslearn.train_util.Dataset(in_paths, out_paths)[source]

Dataset for numpy files

Parameters
  • in_paths (list) – List of paths to input files

  • out_paths (list) – List of paths to output files

__getitem__(idx)[source]

Get a pair of input and target

Parameters

idx (int) – index of the pair

Returns

input and target in numpy format

Return type

tuple

__len__()[source]

Returns the size of the dataset

Returns

size of the dataset

Return type

int

DataLoader

collate_fn_dnntts

Collate function for DNN-TTS.

collate_fn_wavenet

Collate function for WaveNet.

collate_fn_tacotron

Collate function for Tacotron.

get_data_loaders

Get data loaders for training and validation.

Model parameters

moving_average_

Exponential moving average (EMA) of model parameters.

num_trainable_params

Count the number of trainable parameters in the model.

Helper for training

setup

Setup for traiining

save_checkpoint

Save a checkpoint.

num_trainable_params

Count the number of trainable parameters in the model.

get_epochs_with_optional_tqdm

Get epochs with optional progress bar.

Plotting

plot_attention

Plot attention.

plot_2d_feats

Plot 2D features.