pytorch
TorchDataset(inputs, outputs=None)
Bases: Dataset[tuple[Tensor, Tensor]]
Dataset for PyTorch.
Initialize the TorchDataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
inputs
|
DataFrame
|
The input data. |
required |
outputs
|
DataFrame | None
|
The output data. Defaults to None. |
None
|
Source code in src/flowcean/environments/pytorch.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
__len__()
Return the length of the dataset.
Source code in src/flowcean/environments/pytorch.py
24 25 26 |
|
__getitem__(item)
Return the item at the given index.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item
|
int
|
The index of the item to return. |
required |
Returns:
Type | Description |
---|---|
tuple[Tensor, Tensor]
|
The inputs and outputs at the given index. |
Source code in src/flowcean/environments/pytorch.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|