Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ersi lig 4471 cleanup and merge mae branch #1510

Conversation

ersi-lightly
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Feb 29, 2024

Codecov Report

Attention: Patch coverage is 10.52632% with 17 lines in your changes are missing coverage. Please review.

Project coverage is 82.07%. Comparing base (90a2ee0) to head (2b2a2d2).

Files Patch % Lines
lightly/models/modules/masked_autoencoder_timm.py 0.00% 10 Missing ⚠️
...y/models/modules/masked_vision_transformer_timm.py 0.00% 4 Missing ⚠️
...s/modules/masked_vision_transformer_torchvision.py 40.00% 3 Missing ⚠️
Additional details and impacted files
@@                              Coverage Diff                               @@
##           ersi-lig-3912-refactor-mae-to-use-timm-vit    #1510      +/-   ##
==============================================================================
+ Coverage                                       81.96%   82.07%   +0.10%     
==============================================================================
  Files                                             144      144              
  Lines                                            6073     6065       -8     
==============================================================================
  Hits                                             4978     4978              
+ Misses                                           1095     1087       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ersi-lightly ersi-lightly changed the base branch from master to ersi-lig-3912-refactor-mae-to-use-timm-vit February 29, 2024 15:59
Copy link
Contributor

@guarin guarin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Left some comments but looks pretty much ready to be merged.

lightly/models/modules/masked_vision_transformer.py Outdated Show resolved Hide resolved
lightly/models/modules/masked_vision_transformer_timm.py Outdated Show resolved Hide resolved
lightly/models/modules/masked_vision_transformer_timm.py Outdated Show resolved Hide resolved
benchmarks/imagenet/vitb16/mae.py Outdated Show resolved Hide resolved
lightly/models/modules/masked_autoencoder_timm.py Outdated Show resolved Hide resolved
lightly/models/modules/masked_autoencoder_timm.py Outdated Show resolved Hide resolved
lightly/models/modules/masked_vision_transformer_timm.py Outdated Show resolved Hide resolved
Copy link
Contributor

@guarin guarin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

lightly/models/modules/masked_autoencoder_timm.py Outdated Show resolved Hide resolved
lightly/models/modules/masked_autoencoder_timm.py Outdated Show resolved Hide resolved
@ersi-lightly ersi-lightly merged commit d89808f into ersi-lig-3912-refactor-mae-to-use-timm-vit Mar 5, 2024
9 of 10 checks passed
@ersi-lightly ersi-lightly deleted the ersi-lig-4471-cleanup-and-merge-mae-branch branch March 5, 2024 08:55
ersi-lightly added a commit that referenced this pull request Mar 6, 2024
* Add MAE evaluation

* Add stochastic depth dropout

* Add MAE

* Drop assertion

* Fix smooth cross entropy loss and mixup

* Update comments

* Add layer lr decay and weight decay

* Update comment

* Add test for MAE images_to_tokens

* Disable BN update

* Add BN before classification head

* Format

* Fix BN freezing

* Cleanup

* Use torch.no_grad instead of deactivating gradients manually

* This is required as torch.no_grad doesn't change the model configuration
  while manual gradient deactivation/activation can have unintended
  consequences. For example, MAE ViT positional embeddings are parameters
  with requires_grad=False that should never receive an update. But if
  we use activate_requires_grad for finetuning we break those
  parameters.

* Create new stochastic depth instances

* Add mask token to learnable params

* Add sine-cosine positional embedding

* Initialize parameters as in paper

* Fix types

* Format

* adjusted to existing interface

* draft

* remove

* added modifications

* added mae implementation with timm and example

* formatted

* fixed import

* removed

* fixed typing

* addressed comments

* fixed typing and formatted

* addressed comments

* added docstring and formatted

* removed images to tokens method

* Ersi lig 3910 update mae benchmark code (#1468)

* modified imagenette benchmark

* formatted

* edited vitb16 benchmark

* added the posibility to handle images of different sizes

* formatted

* removed comments

* revert

* changed import

* initialize class token

* specified that class token should be used

* chabged architecture

* addressed comments

* formatted

* Masked vision transformer (#1482)

* added hackathon

* changed comments

* formatted

* addressed comments

* fixed typing

* addressed comments

* added pre-norm and fixed arguments

* added masked vision transformer with Torchvision

* weight initialization

* cleanup

* modifies imagenette benchmark

* made mask token optional and adapted benchmarks

* removed unused import

* adapted to dynamic image size

* moved positional embed init  to utils

* updated benchmark

* adapted benchmark

* moved mask token to decoder

* revert example

* removed example

* removed file

* inheriting from Module

* reverted dataset paths

* use timm's drop_path_rate

* removed unused import

* removed private method

* changed slicing

* formatted

* path dropout only for fine tune

* formatted

* account for mask token in backbone

* mask token of decoder

* removed appending of mask token in params

* resolved conflicts

* formatted

* adjusted examples

* removed comment

* added test

* added message in case of ImportError

* fixed skipping of test

* removed example

* handling the TIMM dependency

* added note to docs for MAE installation

* added unit tests for MAE with torchvision

* removed unecessary maks token definition

* addressed comments

* moved test to separate file

* added typing

* fixed import

* fixes typing

* fixed typing

* fixed typing

* Ersi lig 4471 cleanup and merge mae branch (#1510)

* renamed test class

* fixed imports

* ficed imports

* fixed import

* fixed imports and decreased batch size

* format

* removed comments

* use function defined in utils

* added docstrings

* added doctrings

* added docstring

* formatted

* formatted

* import Tensor

---------

Co-authored-by: guarin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants