dynabench.dataset.transforms
Functions
|
A decorator indicating abstract methods. |
|
Shallow copy operation on arbitrary Python objects. |
Classes
|
Helper class that provides a standard way to create an ABC using inheritance. |
|
|
|
Data class for 2D grid data. |
|
Compose function for combining multiple transforms. |
|
Base class for data items. |
Default transformation for a data item. |
|
|
Create an edge list graph (src, dst) to use with PyG. |
Create an edge list from the KNN graph. |
|
Create a Cloud item from a grid data item |
|
|
Data class for grid data. |
|
Downsample the grid to a smaller size using FFT. |
|
Downsample the grid by a factor. |
|
|
|
kd-tree for quick nearest-neighbor lookup. |
|
Create a KNN graph from the cloud data. |
|
Point sampling transform for the dataset. |
|
Convert the data item to a dictionary. |
|
Cast the data item to the correct type. |
- class dynabench.dataset.transforms.Compose(transforms: List[BaseTransform])[source]
Bases:
BaseTransform
Compose function for combining multiple transforms. Iterates over transformations and applies them to the data item.
- Parameters:
transforms (List[BaseTransform]) – List of transforms to be applied to the data
- class dynabench.dataset.transforms.DefaultTransform[source]
Bases:
BaseTransform
Default transformation for a data item. Does not modify the data.
- Parameters:
data_item (DataItem)
- Returns:
transformed data_item
- Return type:
DataItem
- class dynabench.dataset.transforms.EdgeList(k: int)[source]
Bases:
Compose
Create an edge list graph (src, dst) to use with PyG.
- Parameters:
data_item (CloudItem)
- Returns:
data_item with edge_list as knn_graph
- Return type:
CloudItem
- class dynabench.dataset.transforms.EdgeListFromKNN[source]
Bases:
BaseTransform
Create an edge list from the KNN graph.
- Parameters:
data_item (CloudItem)
- Returns:
data_item with knn_graph
- Return type:
CloudItem
- class dynabench.dataset.transforms.Grid2Cloud[source]
Bases:
BaseTransform
Create a Cloud item from a grid data item
- Parameters:
data_item (GridItem)
- Returns:
data_item with cloud shape
- Return type:
CloudItem
- class dynabench.dataset.transforms.GridDownsampleFFT(target_size: Tuple[int, int] = (1.0, 1.0))[source]
Bases:
BaseTransform
Downsample the grid to a smaller size using FFT.
- Parameters:
target_size (Tuple[int, int]) – Target size of the grid.
- class dynabench.dataset.transforms.GridDownsampleFactor(factor: int = 2)[source]
Bases:
BaseTransform
Downsample the grid by a factor.
- Parameters:
factor (int) – Factor by which to downsample the grid.
- class dynabench.dataset.transforms.KNNGraph(k: int, grid_limits: Tuple[float] = (1.0, 1.0))[source]
Bases:
BaseTransform
Create a KNN graph from the cloud data.
- Parameters:
data_item (CloudItem)
- Returns:
data_item with knn_graph
- Return type:
CloudItem
- class dynabench.dataset.transforms.PointSampling(num_points: int = 900)[source]
Bases:
BaseTransform
Point sampling transform for the dataset.
- Parameters:
num_points (int) – Number of points to sample.
k (int) – Number of nearest neighbors to use for the KNN graph.
- class dynabench.dataset.transforms.ToDict[source]
Bases:
BaseTransform
Convert the data item to a dictionary.
- Parameters:
data_item (DataItem)
- Returns:
data_item as a dictionary
- Return type:
dict
- class dynabench.dataset.transforms.TypeCaster(dtype: ~numpy.dtype = <class 'numpy.float32'>)[source]
Bases:
BaseTransform
Cast the data item to the correct type. (In place!!!)