Closed guarin closed 5 months ago
Attention: 108 lines
in your changes are missing coverage. Please review.
Comparison is base (
21bd179
) 85.56% compared to head (6b93bf5
) 84.40%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
FWIW, this PR caused a bit of a headache for us in TorchGeo: https://github.com/microsoft/torchgeo/issues/1824
At the moment, the changes here make lightly v1.4.26 incompatible with any version of segmentation-models-pytorch. This isn't necessarily your fault, but it would help if you could check the version of timm available before importing everything else.
This PR implements the
AIM
model proposed in Scalable Pre-training of Large Autoregressive Image Models. The implementation is based on the original code but uses a modified version of the vision transformer from timm as backbone. The backbone is fully compatible with the timm vision transformer and pretrained weights from our backbone should be loadable with the timm vision transformer (state dicts are identical).The implementation is a best effort. The paper and reference code miss some crucial information. Specifically, the prefix length and detailed description of the MLP architecture for the prediction head are missing. Nevertheless, the current implementation is running and is hopefully a good start.I checked with the authors, the head and prefix masking should be correct now :)Changes
MaskedCausalVisionTransformer
AIMPredictionHead
AIMTransform
AIM
benchmark moduleTODO:
We also have to figure out whether we want to add this to
benchmarks/imagenet/vitb16
because the backbone is clearly not vitb16 😅How was it tested?
For Review
Review is only required for the following files/functions:
benchmarks/imagenet/vitb16/aim.py
lightly/models/modules/__init__.py
lightly/models/modules/heads_timm.py
lightly/models/modules/masked_causal_vision_transformer.py
lightly/models/utils.py
->random_prefix_mask
functionlightly/transforms/aim_transform.py
The other files/functions have already been reviewed in other PRs but are not yet on master.