nnsvs.train_util

Specific utilities for training

Helper for training

setup

Setup for training

save_checkpoint

Save a checkpoint.

num_trainable_params

Count the number of trainable parameters in the model.

DataLoader

batch_by_size

Yield mini-batches of indices bucketed by size.

collate_fn_default

Create batch

collate_fn_random_segments

Collate function with random segments

get_data_loaders

Get data loaders for training and validation.

Plotting

plot_spsvs_params

Plot acoustic parameters of parametric SVS

Misc

note_segments

Compute note segments (start and end indices) from log-F0

compute_pitch_regularization_weight

Compute pitch regularization weight given note segments

compute_batch_pitch_regularization_weight

Batch version of computing pitch regularization weight

compute_distortions

Compute distortion measures between predicted and ground-truth acoustic features

ensure_divisible_by

Ensure that the number of frames is divisible by N.