imagenet
Bases: vision_dataloader
A dataloader for the ImageNet dataset.
Handles loading and preprocessing of the ImageNet dataset.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
Name of the dataloader, default is 'imagenet'. |
train_batch_size |
int
|
Batch size for training data. |
test_batch_size |
int
|
Batch size for testing data. |
Methods:
Name | Description |
---|---|
__init__ |
Initializes the ImageNet dataloader. |
load |
Loads and preprocesses the ImageNet dataset. |
Source code in tinybig/data/vision_dataloader.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
__init__(name='imagenet', train_batch_size=64, test_batch_size=64)
Initializes the ImageNet dataloader.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the dataloader, default is 'imagenet'. |
'imagenet'
|
train_batch_size
|
int
|
Batch size for training data, default is 64. |
64
|
test_batch_size
|
int
|
Batch size for testing data, default is 64. |
64
|
Returns:
Type | Description |
---|---|
None
|
|
Source code in tinybig/data/vision_dataloader.py
load(cache_dir='./data/', with_transformation=True, *args, **kwargs)
Loads and preprocesses the ImageNet dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cache_dir
|
str
|
Directory to cache the dataset, default is './data/'. |
'./data/'
|
with_transformation
|
bool
|
Whether to load the training or testing dataset with transformation, default is True. |
True
|
*args
|
Additional arguments for dataset loading. |
()
|
|
**kwargs
|
Additional arguments for dataset loading. |
()
|
Returns:
Type | Description |
---|---|
dict
|
A dictionary containing the train and test dataloaders. |