nnsvs.util

General utility

Example files

example_xml_file

Get the path to an included xml file.

Initialization

init_weights

Initialize network weights.

init_seed

Initialize random seed.

Multi-stream helper

get_world_stream_info

Get stream sizes for WORLD-based acoustic features

Mask

make_pad_mask

Make mask tensor containing indices of padded part.

make_non_pad_mask

Make mask tensor containing indices of non-padded part.

Padding

pad_2d

Pad a 2d-tensor.

Path

load_utt_list

Load a list of utterances.

Scalers

class nnsvs.util.PyTorchStandardScaler(mean, scale)[source]

PyTorch module for standardization.

Parameters:
  • mean (torch.Tensor) – mean

  • scale (torch.Tensor) – scale

class nnsvs.util.StandardScaler(mean, var, scale)[source]

sklearn.preprocess.StandardScaler like class with only transform functionality

Parameters:
  • mean (np.ndarray) – mean

  • var (np.ndarray) – variance

  • scale (np.ndarray) – scale

class nnsvs.util.MinMaxScaler(min, scale, data_min=None, data_max=None, feature_range=(0, 1))[source]

sklearn.preprocess.MinMaxScaler like class with only transform functionality

Parameters:
  • min (np.ndarray) – minimum

  • scale (np.ndarray) – scale

  • data_min (np.ndarray) – minimum of input data

  • data_max (np.ndarray) – maximum of input data

  • feature_range (tuple) – (min, max)

Misc

dynamic_import

Dynamic import