1 vin.modules.semidense_grid
vin.modules.semidense_grid
Semidense projection-grid encoders for VIN scorers.
This module owns reusable torch.nn.Module blocks that transform per-candidate screen-space semidense projection grids into compact feature vectors. The geometry helper aria_nbv.vin.geometry.semidense_projection.build_projection_grid constructs the deterministic grid; the encoder defined here owns the learnable convolutional projection used by the active VIN v3 scorer.
1.1 Classes
| Name | Description |
|---|---|
| SemidenseGridEncoder | Encode semidense projection grids with a small convolutional head. |
| SemidenseGridEncoderConfig | Configure the VIN semidense projection-grid CNN. |
1.1.1 SemidenseGridEncoder
vin.modules.semidense_grid.SemidenseGridEncoder(config)Encode semidense projection grids with a small convolutional head.
The class subclasses torch.nn.Sequential intentionally: when assigned to VinModelV3.semidense_cnn, learnable parameters keep the historical checkpoint keys semidense_cnn.0.*, semidense_cnn.2.*, and semidense_cnn.6.*. Do not wrap the layers in a child module unless a checkpoint migration is planned.
1.1.1.1 Methods
| Name | Description |
|---|---|
| encode_projection_features | Return one CNN feature vector per batch/candidate projection. |
1.1.1.1.1 encode_projection_features
vin.modules.semidense_grid.SemidenseGridEncoder.encode_projection_features(
proj_data,
*,
batch_size,
num_candidates,
device,
dtype,
)Return one CNN feature vector per batch/candidate projection.
1.1.1.1.1.1 Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| proj_data | dict[str, Tensor] | Projection output from aria_nbv.vin.geometry.semidense_projection.project_points_to_candidate_cameras. |
required |
| batch_size | int | Batch size B. |
required |
| num_candidates | int | Number of candidate cameras N_q. |
required |
| device | torch.device | Device for the intermediate projection grid. | required |
| dtype | torch.dtype | Floating point dtype for the grid and returned features. | required |
1.1.1.1.1.2 Returns
| Name | Type | Description |
|---|---|---|
| Tensor | Tensor["B N_q F", float32] where F is |
|
| Tensor | SemidenseGridEncoderConfig.out_dim. |
1.1.2 SemidenseGridEncoderConfig
vin.modules.semidense_grid.SemidenseGridEncoderConfig()Configure the VIN semidense projection-grid CNN.
1.1.2.1 Attributes
| Name | Description |
|---|---|
| target_type | Factory target for BaseConfig.setup_target. |
| grid_size | Spatial side length of the deterministic projection grid. |
| channels | Hidden channel width for the convolutional layers. |
| out_dim | Output feature dimension per candidate projection. |