Commit Graph

14 Commits (66a0eb46731d2c2c5ea2c035d4b83fc69fa0bd92)

Author SHA1 Message Date
Ross Wightman a5a2ad2e48 Fix consistency, testing for forward_head w/ pre_logits, reset_classifier, models with pre_logits size != unpooled feature size
* add test that model supports forward_head(x, pre_logits=True)
* add head_hidden_size attr to all models and set differently from num_features attr when head has hidden layers
* test forward_features() feat dim == model.num_features and pre_logits feat dim == self.head_hidden_size
* more consistency in reset_classifier signature, add typing
* asserts in some heads where pooling cannot be disabled
Fix #2194
2024-06-07 13:53:00 -07:00
Ross Wightman cb57a96862 Fix early stop for efficientnet/mobilenetv3 fwd inter. Fix indices typing for all fwd inter. 2024-05-04 10:21:58 -07:00
Ross Wightman c719f7eb86 More forward_intermediates() updates
* add convnext, resnet, efficientformer, levit support
* remove kwargs only for fn so that torchscript isn't broken for all :(
* use reset_classifier() consistently in prune
2024-05-03 16:22:32 -07:00
Ross Wightman 67332fce24 Add features_intermediate() support to coatnet, maxvit, swin* models. Refine feature interface. Start prep of new vit weights. 2024-04-30 16:56:33 -07:00
Ross Wightman 4b2565e4cb More forward_intermediates() / FeatureGetterNet work
* include relpos vit
* refactor reduction / size calcs so hybrid vits work and dynamic_img_size works
* fix -ve feature indices when pruning
* fix mvitv2 w/ class token
* refine naming
* add tests
2024-04-10 15:11:34 -07:00
Ross Wightman 679daef76a More forward_intermediates() & features_only work
* forward_intermediates() added to beit, deit, eva, mvitv2, twins, vit, vit_sam
* add features_only to forward intermediates to allow just intermediate features
* fix #2060
* fix #1374
* fix #657
2024-04-09 21:29:16 -07:00
Yassine 884ef88818 fix all SDPA dropouts 2023-10-05 08:58:41 -07:00
Ross Wightman 3055411c1b
Fix samvit bug, add F.sdpa support and ROPE option (#1920)
* Fix a bug I introduced in samvit, add F.sdpa support and ROPE option to samvit, neck is LayerNorm if not used and standard classifier used

* Add attn dropout to F.sdpa

* Fix fx trace for sam vit

* Fixing torchscript issues in samvit

* Another torchscript fix

* samvit head fc name fix
2023-08-20 21:22:59 -07:00
Yonghye Kwon 2048f6f20f
set self.num_features to neck_chans if neck_chans > 0 2023-08-11 13:45:06 +09:00
SeeFun c3f24a5ae5
‘add ViT weight from I-JEPA pretrain’ 2023-06-14 22:30:31 +08:00
Ross Wightman e9373b1b92 Cleanup before samvit merge. Resize abs posembed on the fly, undo some line-wraps, remove redundant unbind, fix HF hub weight load 2023-05-18 16:43:48 -07:00
方曦 c1c6eeb909 fix loading pretrained weight for samvit 2023-05-18 08:49:29 +08:00
方曦 15de561f2c fix unit test for samvit 2023-05-17 12:51:12 +08:00
方曦 ea1f52df3e add ViT for Segment-Anything Model 2023-05-17 11:39:29 +08:00