mnist
Bases: vision_dataloader
A dataloader for the MNIST dataset.
Handles loading and preprocessing of the MNIST dataset.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
Name of the dataloader, default is 'mnist'. |
train_batch_size |
int
|
Batch size for training data. |
test_batch_size |
int
|
Batch size for testing data. |
Methods:
Name | Description |
---|---|
__init__ |
Initializes the MNIST dataloader. |
load |
Loads and preprocesses the MNIST dataset. |
Source code in tinybig/data/vision_dataloader.py
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 |
|
__init__(name='mnist', train_batch_size=64, test_batch_size=64)
Initializes the MNIST dataloader.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the dataloader, default is 'mnist'. |
'mnist'
|
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 MNIST 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. |