py123d_detection.torch.models.petr.positional_encoding¶
Classes
|
Position encoding with sine and cosine functions. |
- class py123d_detection.torch.models.petr.positional_encoding.SinePositionalEncoding3D(*args: Any, **kwargs: Any)[source]¶
Bases:
ModulePosition encoding with sine and cosine functions.
Adapted from mmcv’s
SinePositionalEncoding, extended to three axes. See End-to-End Object Detection with Transformers for the original.- Parameters:
num_feats – Feature dimension per position and per axis. The returned dimension is twice this, because each axis contributes a sine and a cosine.
temperature – Scaling of the position embedding.
normalize – Normalise the embedding by the extent of the unmasked region.
scale – Factor applied to the normalised embedding; used only when
normalizeis set.eps – Added to the denominator for numerical stability.
offset – Added to the embedding before normalising.