Dataset
HexagonalDataset.
This dataset is used to train a hexagonal encoder model. As defined in GeoVex paper[1].
References
¶
Bases: Dataset['torch.Tensor']
, Generic[T]
Dataset for the hexagonal encoder model.
It works by returning a 3d tensor of hexagonal regions. The tensor is a cube with the target hexagonal region in the center, and the rings of neighbors around surrounding it.
PARAMETER | DESCRIPTION |
---|---|
data |
Data to use for training. Raw counts of features in regions.
TYPE:
|
neighbourhood |
H3Neighbourhood to use for training. It has to be initialized with the same data as the data argument.
TYPE:
|
neighbor_k_ring |
The hexagonal rings of neighbors to include in the tensor. Defaults to 6.
TYPE:
|
Source code in srai/embedders/geovex/dataset.py
¶
Returns the number of valid h3 indices in the dataset.
RETURNS | DESCRIPTION |
---|---|
int
|
Number of valid h3 indices in the dataset.
TYPE:
|
¶
Return a single item from the dataset.
PARAMETER | DESCRIPTION |
---|---|
index |
The index of dataset item to return
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
HexagonalDatasetItem
|
The dataset item
TYPE:
|
Source code in srai/embedders/geovex/dataset.py
¶
Returns the list of valid h3 indices in the dataset.
RETURNS | DESCRIPTION |
---|---|
list[str]
|
List[str]: List of valid h3 indices in the dataset. |
¶
Returns the list of invalid h3 indices in the dataset.
RETURNS | DESCRIPTION |
---|---|
list[str]
|
List[str]: List of invalid h3 indices in the dataset. |