hookeai.miscellaneous.pruning.pruning_dataset.perform_pruning_step

perform_pruning_step(prun_datasets_dir, pruning_params, dev_dataset, unused_dataset, device_type='cpu', is_verbose=False)[source]

Perform pruning step.

Parameters:
  • prun_datasets_dir (str) – Pruned data sets directory.

  • pruning_params (dict) – Pruning parameters.

  • dev_dataset (torch.utils.data.Dataset) – Time series development data set. Each sample is stored as a dictionary where each feature (key, str) data is a torch.Tensor(2d) of shape (sequence_length, n_features).

  • unused_dataset (torch.utils.data.Dataset) – Time series unused data set. Each sample is stored as a dictionary where each feature (key, str) data is a torch.Tensor(2d) of shape (sequence_length, n_features).

  • device_type ({'cpu', 'cuda'}, default='cpu') – Type of device on which torch.Tensor is allocated.

  • is_verbose (bool, default=False) – If True, enable verbose output.

Returns:

  • is_valid_pruning_step (bool) – If True, then pruning step is admissible and is performed. If False, then pruning step is non-admissible and data sets are unchanged.

  • step_status (str) – Pruning step status.

  • dev_dataset (torch.utils.data.Dataset) – Time series development data set. Each sample is stored as a dictionary where each feature (key, str) data is a torch.Tensor(2d) of shape (sequence_length, n_features).

  • unused_dataset (torch.utils.data.Dataset) – Time series unused data set. Each sample is stored as a dictionary where each feature (key, str) data is a torch.Tensor(2d) of shape (sequence_length, n_features).