Datasets¶
Dataset¶
Basic container for training data with labels
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
training data values |
None
|
y
|
Tensor
|
training data labels |
None
|
split
¶
Splits the data into training and validation Subsets
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frac
|
float
|
The percent of data that will be for training |
required |
shuffle
|
bool
|
Whether the data will be shuffled before split. Defaults to |
True
|
Example
training, validation = dataset.split(frac=0.8, shuffle=True)
Dataloader¶
Iterates over a dataset in mini-batches.
The DataLoader handles batching and optional shuffling, providing an efficient interface for training models.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
Dataset
|
Dataset to iterate over. |
required |
batch_size
|
int
|
Number of samples per batch. |
None
|
shuffle
|
bool
|
Whether to shuffle the dataset at the beginning of each epoch. (defaults to False) |
False
|
drop_remainder
|
bool
|
determins if the final mini batch should be dropped if the data cannot be segmented evenly. (defaults to False) |
False
|
split
¶
Splits the data into training and validation Dataloaders
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frac
|
float
|
The percent of data that will be for training |
required |
shuffle
|
bool
|
Whether the data will be shuffled before split. Defaults to |
False
|
Example
training, validation = dataloader.split(frac=0.8, shuffle=False)