|
11 | 11 | Thanks to the Google team for the above two repositories and associated papers:
|
12 | 12 | * Big Transfer (BiT): General Visual Representation Learning - https://arxiv.org/abs/1912.11370
|
13 | 13 | * An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale - https://arxiv.org/abs/2010.11929
|
| 14 | +* Knowledge distillation: A good teacher is patient and consistent - https://arxiv.org/abs/2106.05237 |
14 | 15 |
|
15 | 16 | Original copyright of Google code below, modifications by Ross Wightman, Copyright 2020.
|
16 | 17 | """
|
@@ -86,6 +87,16 @@ def _cfg(url='', **kwargs):
|
86 | 87 | url='https://storage.googleapis.com/bit_models/BiT-M-R152x4.npz',
|
87 | 88 | num_classes=21843),
|
88 | 89 |
|
| 90 | + 'resnetv2_50x1_bit_distilled': _cfg( |
| 91 | + url='https://storage.googleapis.com/bit_models/distill/R50x1_224.npz', |
| 92 | + input_size=(3, 224, 224), crop_pct=0.875, interpolation='bicubic'), |
| 93 | + 'resnetv2_152x2_bit_teacher': _cfg( |
| 94 | + url='https://storage.googleapis.com/bit_models/distill/R152x2_T_224.npz', |
| 95 | + input_size=(3, 224, 224), crop_pct=0.875, interpolation='bicubic'), |
| 96 | + 'resnetv2_152x2_bit_teacher_384': _cfg( |
| 97 | + url='https://storage.googleapis.com/bit_models/distill/R152x2_T_384.npz', |
| 98 | + input_size=(3, 384, 384), crop_pct=1.0, interpolation='bicubic'), |
| 99 | + |
89 | 100 | 'resnetv2_50': _cfg(
|
90 | 101 | input_size=(3, 224, 224), crop_pct=0.875, interpolation='bicubic'),
|
91 | 102 | 'resnetv2_50d': _cfg(
|
@@ -521,6 +532,33 @@ def resnetv2_152x4_bitm_in21k(pretrained=False, **kwargs):
|
521 | 532 | layers=[3, 8, 36, 3], width_factor=4, **kwargs)
|
522 | 533 |
|
523 | 534 |
|
| 535 | +@register_model |
| 536 | +def resnetv2_50x1_bit_distilled(pretrained=False, **kwargs): |
| 537 | + """ ResNetV2-50x1-BiT Distilled |
| 538 | + Paper: Knowledge distillation: A good teacher is patient and consistent - https://arxiv.org/abs/2106.05237 |
| 539 | + """ |
| 540 | + return _create_resnetv2_bit( |
| 541 | + 'resnetv2_50x1_bit_distilled', pretrained=pretrained, layers=[3, 4, 6, 3], width_factor=1, **kwargs) |
| 542 | + |
| 543 | + |
| 544 | +@register_model |
| 545 | +def resnetv2_152x2_bit_teacher(pretrained=False, **kwargs): |
| 546 | + """ ResNetV2-152x2-BiT Teacher |
| 547 | + Paper: Knowledge distillation: A good teacher is patient and consistent - https://arxiv.org/abs/2106.05237 |
| 548 | + """ |
| 549 | + return _create_resnetv2_bit( |
| 550 | + 'resnetv2_152x2_bit_teacher', pretrained=pretrained, layers=[3, 8, 36, 3], width_factor=2, **kwargs) |
| 551 | + |
| 552 | + |
| 553 | +@register_model |
| 554 | +def resnetv2_152x2_bit_teacher_384(pretrained=False, **kwargs): |
| 555 | + """ ResNetV2-152xx-BiT Teacher @ 384x384 |
| 556 | + Paper: Knowledge distillation: A good teacher is patient and consistent - https://arxiv.org/abs/2106.05237 |
| 557 | + """ |
| 558 | + return _create_resnetv2_bit( |
| 559 | + 'resnetv2_152x2_bit_teacher_384', pretrained=pretrained, layers=[3, 8, 36, 3], width_factor=2, **kwargs) |
| 560 | + |
| 561 | + |
524 | 562 | @register_model
|
525 | 563 | def resnetv2_50(pretrained=False, **kwargs):
|
526 | 564 | return _create_resnetv2(
|
|
0 commit comments