cyto_dl.nn.vits.utils module#
- cyto_dl.nn.vits.utils.get_positional_embedding(num_patches: Sequence[int], emb_dim: int, use_cls_token: bool = True, learnable: bool = True)[source]#
Generate a positional embedding (with or without a cls token) for a given number of patches and embedding dimension.
Can be either learnable or fixed.