Fix: Downsample before embedding in multi-resolution mode and fix fps… #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ensure correct order of FPS downsampling and embedding for multi-resolution inputs; fix import location of fps
Summary
This PR fixes the following issues in the
PerceiverCrossAttentionEncoder._forward()
method:Correct import location for fps:
The function
fps
fromtorch_cluster
is now imported directly before it is used in the multi-resolution downsampling block, preventingNameError
.Correct order of downsampling and embedding:
Multi-resolution FPS downsampling of point clouds and associated features (pc, feats, sharp_pc, sharp_feat) is now performed before any embedding or projection. This ensures that only the downsampled tensors are passed through the embedder and input projections, so shapes are always aligned. No redundant recomputation is performed.
Changes
from torch_cluster import fps
to immediately before usage in theif self.use_multi_reso:
block.use_multi_reso
is enabled), and then perform embedding/projection.Related Issue: #31