noether.data.pipeline.collators¶
Submodules¶
Classes¶
Concatenates a sparse tensor along its first axis. Additionally, creates the batch_idx tensor which maps samples |
|
Applies torch.utils.data.default_collate to the specified items. |
|
Collates a field to be used in a UPT-style decoder. It requires: |
|
Collates sparse tensors by concatenating them along the first axis and creating an offset tensor that maps |
Package Contents¶
- class noether.data.pipeline.collators.ConcatSparseTensorCollator(items, create_batch_idx=False, batch_idx_key='batch_idx')¶
Concatenates a sparse tensor along its first axis. Additionally, creates the batch_idx tensor which maps samples to their respective index in a batch.
- Parameters:
items (list[str]) – Which pointcloud items (i.e., keys in the sample dictionaries) should be collated.
create_batch_idx (bool) – If true, creates a batch_idx tensor that maps samples to their index in the batch. Defaults to False.
batch_idx_key (str) – How the generated batch_idx tensor should be called. Defaults to “batch_idx”. If multiple batch_idx tensors are generated, this needs to be set to distinguish between them. For example, if a subsampled pointcloud is loaded and also the raw pointcloud without subsampling one could use batch_idx for the subsampled pointcloud and batch_idx_raw for the raw pointcloud.
- items¶
- create_batch_idx = False¶
- batch_idx_key = 'batch_idx'¶
- class noether.data.pipeline.collators.DefaultCollator(items=None, optional_items=None)¶
Applies torch.utils.data.default_collate to the specified items.
- Parameters:
- items = None¶
- optional_items = None¶
- class noether.data.pipeline.collators.FieldDecoderCollator(position_item, target_items)¶
Collates a field to be used in a UPT-style decoder. It requires: - Positions as dense tensor (used as query for the Perceiver decoder) - Targets as sparse tensor (e.g., used for calculating a loss) - Unbatch mask to convert the dense output of the Perceiver decoder into a sparse tensor to compare it to the
targets (i.e., calculate a loss)
- Parameters:
- position_item¶
- target_items¶
- class noether.data.pipeline.collators.SparseTensorOffsetCollator(item, offset_key)¶
Bases:
noether.data.pipeline.collator.CollatorCollates sparse tensors by concatenating them along the first axis and creating an offset tensor that maps each sample to its respective index in the batch.
- item¶
- offset_key¶