suinleelab / vit-shapley

25 stars 6 forks source link

[Q] Can the surrogate weights be loaded in timm's ViT? #8

Closed NightMachinery closed 6 months ago

NightMachinery commented 9 months ago

Can the surrogate weights be loaded in timm's ViT? Which library is the model's parameter naming convention from?

chanwkimlab commented 9 months ago

Yes, we used the ViT implementation in the timm library (ver. 0.5.4), so I think that's possible unless the parameter naming convention of timm library has changed since the version: https://github.com/suinleelab/vit-shapley/blob/master/vit_shapley/modules/vision_transformer.py

NightMachinery commented 9 months ago

@chanwkimlab Thanks! There are two files for each model:

https://aimslab.cs.washington.edu/vitshapley/checkpoints/ImageNette_vit_base_patch16_224_surrogate_3i6zzjnp.ckpt
https://aimslab.cs.washington.edu/vitshapley/checkpoints/ImageNette_vit_base_patch16_224_surrogate_3i6zzjnp_state_dict.ckpt

Am I correct in assuming that I only need to download the state_dict.ckpt files? Which is loadable using torch.load?