cifar10
Bases: vision_dataloader
A dataloader for the CIFAR-10 dataset.
Handles loading and preprocessing of the CIFAR-10 dataset.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
Name of the dataloader, default is 'cifar10'. |
train_batch_size |
int
|
Batch size for training data. |
test_batch_size |
int
|
Batch size for testing data. |
Methods:
Name | Description |
---|---|
__init__ |
Initializes the CIFAR-10 dataloader. |
load |
Loads and preprocesses the CIFAR-10 dataset. |
Source code in tinybig/data/vision_dataloader.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
|
__init__(name='cifar10', train_batch_size=64, test_batch_size=64)
Initializes the CIFAR-10 dataloader.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the dataloader, default is 'cifar10'. |
'cifar10'
|
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 CIFAR-10 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, and the class labels. |