Dataset#

class src.data.DatasetManager.DatasetManager(data_files_dir: str, data_load: str, experiment_files_dir: str, plots_dir: str, dtype: dtype, representation_name: str, representation_dir_name: str, transform_name: list, compute_representation: bool = False, reconstruct_flag: bool = False, use_ddp: bool = False, experiment: Experiment | None = None, debug_flag: bool = False)#

Bases: Dataset

Class that handles the creation of the training, validation and testing datasets.

audio_reconstruction(normalize: bool = True, map_location: str | None = 'cpu') None#

Method that reconstructs audio signals using enhanced coefficients.

Parameters:
  • normalize (bool) -- Boolean that indicates weather to normalize audio data.

  • map_location (Optional[str]) -- Remap storage location.

audio_to_tensor(audio_dir: str, verbose: bool = True) Tensor#

Method that loads audio data into one tensor.

Parameters:
  • audio_dir (str) -- Audio data directory.

  • verbose (bool) -- Boolean that indicates weather to print specific output.

compute_representation_fn(dataset_type: str, dataset_dir: str, tensor_coefficients_dir: str)#

Method that computes data representation using audio data.

Parameters:
  • dataset_type (str) -- 'noisy' or 'clean' audio.

  • dataset_dir (str) -- Audio data directory.

  • tensor_coefficients_dir (str) -- Representation coefficients directory.

get_coefficients(coefficients_dir: str, index: int, map_location: str | None = None, verbose: bool = False) Tensor#

Method that loads representation coefficients.

Parameters:
  • coefficients_dir (str) -- Data directory.

  • index (int) -- Sample index.

  • map_location (Optional[str]) -- Remap storage location.

  • verbose (bool) -- Boolean that indicates weather to print specific output.

get_weights(verbose: bool = False) Tensor#

Method that loads LCA weights.

Parameters:

verbose (bool) -- Boolean that indicates weather to print specific output.

load_audio(file_dir: str, normalize: bool = True, pad_flag: bool = True, pad_mode: str = 'circular', update_info: bool = True) Tensor#

Method that loads audio waveform.

Parameters:
  • file_dir (str) -- Audio file directory.

  • normalize (bool) -- Boolean that indicates weather to normalize audio data.

  • pad_flag (bool) -- Boolean that indicates weather to pad audio waveform.

  • pad_mode (str) -- Audio padding mode: 'constant' using zeros or 'circular'.

  • update_info (bool) -- Boolean that indicates weather to update metadata dictionary.

prepare_valid_audio() None#

Method that checks the existance of 'valid' audio data.