CoAtNet-0 backbone (Dai et al., 2021).
Builds the canonical CoAtNet-0 configuration:
blocks_per_stage=(2, 3, 5, 2), dims=(96, 192, 384, 768),
stem_width=64, attn_heads=(12, 24),
head_hidden_size=768. The first two stages are MBConv with
expansion ratio 4 and the last two stages are relative-attention
transformers with head dim 32. Approximately 25.6M parameters.
Model Size
Parameters
pretrainedbool= FalseIf
True, loads ImageNet-1k pretrained weights when
available in the model zoo. Defaults to False.**overridesobject= {}Keyword overrides applied on top of the canonical CoAtNet-0
config. Common examples:
image_size=384, in_channels=1,
head_hidden_size=None. Each override must match a field of
CoAtNetConfig.Returns
CoAtNetA CoAtNet backbone returning a
spatial feature map.
Notes
CoAtNet-0 reaches 81.6% top-1 on ImageNet-1k at 224x224 (Dai et al., 2021, Table 5). See arXiv:2106.04803.
Examples
>>> import lucid
>>> from lucid.models.vision.coatnet import coatnet_0
>>> model = coatnet_0()
>>> x = lucid.randn(1, 3, 224, 224)
>>> feat = model.forward_features(x)
>>> feat.shape
(1, 768, 7, 7)