DOFA#
- class torchgeo.models.DOFA(img_size=224, patch_size=16, drop_rate=0.0, embed_dim=1024, depth=24, num_heads=16, dynamic_embed_dim=128, num_classes=45, global_pool=True, mlp_ratio=4.0, norm_layer=functools.partial(<class 'torch.nn.modules.normalization.LayerNorm'>, eps=1e-06))[source]#
Bases:
ModuleDynamic One-For-All (DOFA) model.
Reference implementation:
If you use this model in your research, please cite the following paper:
Added in version 0.6.
- __init__(img_size=224, patch_size=16, drop_rate=0.0, embed_dim=1024, depth=24, num_heads=16, dynamic_embed_dim=128, num_classes=45, global_pool=True, mlp_ratio=4.0, norm_layer=functools.partial(<class 'torch.nn.modules.normalization.LayerNorm'>, eps=1e-06))[source]#
Initialize a new DOFA instance.
- Parameters:
img_size (int) – Input image size.
patch_size (int) – Patch size.
drop_rate (float) – Head dropout rate.
embed_dim (int) – Transformer embedding dimension.
depth (int) – Depth of transformer.
num_heads (int) – Number of attention heads.
dynamic_embed_dim (int) – Dimensions of dynamic weight generator.
num_classes (int) – Number of classes for classification head.
global_pool (bool) – Whether or not to perform global pooling.
mlp_ratio (float) – Ratio of MLP hidden dim to embedding dim.
- torchgeo.models.dofa_small_patch16_224(*args, **kwargs)[source]#
Dynamic One-For-All (DOFA) small patch size 16 model.
If you use this model in your research, please cite the following paper:
Added in version 0.6.
- torchgeo.models.dofa_base_patch16_224(weights=None, *args, **kwargs)[source]#
Dynamic One-For-All (DOFA) base patch size 16 model.
If you use this model in your research, please cite the following paper:
Added in version 0.6.
- torchgeo.models.dofa_large_patch16_224(weights=None, *args, **kwargs)[source]#
Dynamic One-For-All (DOFA) large patch size 16 model.
If you use this model in your research, please cite the following paper:
Added in version 0.6.
- torchgeo.models.dofa_huge_patch14_224(*args, **kwargs)[source]#
Dynamic One-For-All (DOFA) huge patch size 14 model.
If you use this model in your research, please cite the following paper:
Added in version 0.6.