py123d_detection.torch.models.petr.transformer¶
PETR’s decoder: plain multi-head attention over all camera tokens at once.
Geometry never enters the attention itself. It arrives as a 3D positional embedding added to the keys, so a query attending to a pixel already knows where in space that pixel could be looking. That is the whole of PETR’s idea, and it is why the decoder below is an ordinary transformer.
Classes
|
A wrapper for |
|
|
|
|
|
- class py123d_detection.torch.models.petr.transformer.PETRMultiheadAttention(*args: Any, **kwargs: Any)[source]¶
Bases:
ModuleA wrapper for
torch.nn.MultiheadAttention. This module implements MultiheadAttention with identity connection, and positional encoding is also passed as input.
- class py123d_detection.torch.models.petr.transformer.PETRTransformerDecoderLayer(*args: Any, **kwargs: Any)[source]¶
Bases:
Module
- class py123d_detection.torch.models.petr.transformer.PETRTransformerDecoder(*args: Any, **kwargs: Any)[source]¶
Bases:
Module