redbnn.utils package¶
Submodules¶
redbnn.utils.data module¶
- class redbnn.utils.data.TransformDataset(subset, transform=None)¶
Bases:
Generic[torch.utils.data.dataset.T_co]
- redbnn.utils.data.load_data(dataset_name, data_dir, phases=['train', 'val', 'test'], batch_size=64, subset_size=None)¶
Builds a dictionary containing training, validation and test dataloaders from the chosen dataset.
- Parameters
dataset_name (str) – Name of the chosen dataset.
data_dir (str) – Data path.
phases (str list, optional) – List of desired data phases.
batch_size (int, optional) – Batch size.
subset_size (int, optional) – Subset size. If None loads all the available data for the chosen phases.
- Returns
Dictionary containing dataloaders for the chosen dataset and phases. (int): Number of classes.
- Return type
(dict)
- redbnn.utils.data.transform_data(train_set, val_set, test_set, img_size)¶
Data preprocessing on training, validation and test sets.
- Parameters
train_set (torch.utils.data.dataset.Subset) – Training set.
val_set (torch.utils.data.dataset.Subset) – Validation set.
test_set (torch.utils.data.dataset.Subset) – Test set.
img_size (int) – Size of a flat image.
- Returns
List of transformed training, validation and test sets.
- Return type
(torch.utils.data.dataset.Subset list)
redbnn.utils.networks module¶
- redbnn.utils.networks.execution_time(start, end)¶
- redbnn.utils.networks.get_blocks_dict(network, mode, learnable_only=True)¶
- redbnn.utils.networks.get_first_layer(block)¶
- redbnn.utils.networks.get_reduced_blocks_dict(network, learnable_only=True)¶
- redbnn.utils.networks.is_learnable(block)¶
redbnn.utils.pickling module¶
- redbnn.utils.pickling.load_from_pickle(path, filename)¶
- redbnn.utils.pickling.save_to_pickle(data, path, filename)¶
- redbnn.utils.pickling.unpickle(file)¶
Load byte data from file