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

Update ML Decoder #2045

Draft
wants to merge 48 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
f259cb4
Update ml_decoder.py
fffffgggg54 Nov 27, 2023
ec71960
Update ml_decoder.py
fffffgggg54 Nov 27, 2023
1d3aeb2
Update beit.py
fffffgggg54 Dec 8, 2023
6f65415
Update beit.py
fffffgggg54 Dec 8, 2023
1bc81c5
Update beit.py
fffffgggg54 Dec 8, 2023
e00d7a0
Update edgenext.py
fffffgggg54 Dec 10, 2023
e7661e9
Update edgenext.py
fffffgggg54 Dec 10, 2023
43f6a30
vectorize GroupFC
fffffgggg54 Dec 14, 2023
e6825bb
Update ml_decoder.py
fffffgggg54 Dec 14, 2023
82ebc31
Update ml_decoder.py
fffffgggg54 Dec 14, 2023
1440712
Update ml_decoder.py
fffffgggg54 Dec 14, 2023
2cc0094
Update ml_decoder.py
fffffgggg54 Dec 17, 2023
ec4abba
Update ml_decoder.py
fffffgggg54 Dec 17, 2023
6b2e3f1
Update ml_decoder.py
fffffgggg54 Dec 17, 2023
2befc41
Update ml_decoder.py
fffffgggg54 Dec 17, 2023
6376ad2
Update ml_decoder.py
fffffgggg54 Dec 17, 2023
d3185a9
Update ml_decoder.py
fffffgggg54 Dec 17, 2023
0fbf04f
Update ml_decoder.py
fffffgggg54 Dec 17, 2023
e89b976
Update ml_decoder.py
fffffgggg54 Dec 17, 2023
b2849e9
Update ml_decoder.py
fffffgggg54 Dec 17, 2023
0c39b2b
Update ml_decoder.py
fffffgggg54 Dec 17, 2023
4107c0b
Update ml_decoder.py
fffffgggg54 Dec 17, 2023
0cd2bca
Update ml_decoder.py
fffffgggg54 Dec 17, 2023
162f576
Update ml_decoder.py
fffffgggg54 Dec 17, 2023
7b22abe
Update ml_decoder.py
fffffgggg54 Dec 17, 2023
82c1286
Update ml_decoder.py
fffffgggg54 Dec 17, 2023
b28d03d
Update ml_decoder.py
fffffgggg54 Dec 19, 2023
e7975df
Update ml_decoder.py
fffffgggg54 Dec 25, 2023
4c0781b
Update ml_decoder.py
fffffgggg54 Dec 25, 2023
18ef272
Update ml_decoder.py
fffffgggg54 Dec 26, 2023
4c5f60e
tests
fffffgggg54 Dec 26, 2023
f6bc034
Update ml_decoder.py
fffffgggg54 Jul 2, 2024
abbdf05
head reset will use the same class of head
fffffgggg54 Jul 27, 2024
b927237
Update ml_decoder.py
fffffgggg54 Jul 28, 2024
2c75ebd
Feature: allow custom query in forward
fffffgggg54 Dec 27, 2024
f4b0c46
shared fc option for unseen class 0-shot
fffffgggg54 Dec 27, 2024
32f6e51
act_layer toggle
fffffgggg54 Dec 29, 2024
a41a4d8
Allow merge by adding
fffffgggg54 Dec 29, 2024
04c1eea
num_groups = num_classes QOL
fffffgggg54 Dec 29, 2024
44f93e9
typo
fffffgggg54 Dec 29, 2024
5c32658
Update ml_decoder.py
fffffgggg54 Dec 29, 2024
fbeed51
Update ml_decoder.py
fffffgggg54 Dec 29, 2024
5cac39c
Update ml_decoder.py
fffffgggg54 Dec 29, 2024
bf81448
Update ml_decoder.py
fffffgggg54 Dec 29, 2024
566a843
Update ml_decoder.py
fffffgggg54 Dec 29, 2024
86c1104
Incorrect indexing in GroupLinear
fffffgggg54 Dec 29, 2024
d6bb62f
bias incorrect
fffffgggg54 Dec 29, 2024
ca3b3f0
contiguous
fffffgggg54 Dec 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tests/test_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def test_hard_mish_grad():
for _ in range(100):
_run_act_layer_grad('hard_mish')


def test_get_act_layer_empty_string():
# Empty string should return None
assert get_act_layer('') is None
Expand Down Expand Up @@ -119,3 +120,17 @@ def test_get_act_fn_none():
assert get_act_fn(None) is None
assert get_act_fn('') is None


MLDECODER_EXCLUDE_FILTERS = [
'*efficientnet_l2*', '*resnext101_32x48d', '*in21k', '*152x4_bitm', '*101x3_bitm', '*50x3_bitm',
'*nfnet_f3*', '*nfnet_f4*', '*nfnet_f5*', '*nfnet_f6*', '*nfnet_f7*', '*efficientnetv2_xl*',
'*resnetrs350*', '*resnetrs420*', 'xcit_large_24_p8*', '*huge*', '*giant*', '*gigantic*',
'*enormous*', 'maxvit_xlarge*', 'regnet*1280', 'regnet*2560']

def test_ml_decoder():
for modelName in timm.list_models(pretrained=False, exclude_filters = MLDECODER_EXCLUDE_FILTERS):
model = timm.create_model(modelName, num_classes=1000)
model = add_ml_decoder_head(model)
model.eval()
with torch.set_grad_enabled(False):
model(torch.randn([1,*model.default_cfg['input_size']]))
Loading