TiCO

Contents

TiCO#

class stable_pretraining.methods.TiCO(encoder_name: str | Module = 'vit_small_patch16_224', projector_dims: Sequence[int] = (2048, 256), beta: float = 0.9, rho: float = 20.0, low_resolution: bool = False, pretrained: bool = False)[source]#

Bases: Module

TiCO joint-embedding SSL.

Parameters:
  • encoder_name – timm model or pre-built nn.Module.

  • projector_dims(hidden, output) (default (2048, 256)).

  • beta – EMA momentum for the covariance (default 0.9; paper).

  • rho – Weight on the covariance-contrast term (default 20.0; paper used a sweep around 16-20).

  • low_resolution – Adapt first conv for low-res input.

  • pretrained – Load pretrained timm weights.

forward(view1: Tensor, view2: Tensor | None = None) TiCOOutput[source]#

Same as torch.nn.Module.forward().

Parameters:
  • *args – Whatever you decide to pass into the forward method.

  • **kwargs – Keyword arguments are also possible.

Returns:

Your model’s output