Ejemplo n.º 1
0
def mini_deit_small_patch16_224(pretrained=False, **kwargs):
    return deit_small_patch16_224(pretrained=pretrained,
                                  rpe_config=get_deit_rpe_config(),
                                  use_cls_token=False,
                                  repeated_times=2,
                                  use_transform=True,
                                  **kwargs)
Ejemplo n.º 2
0
def deit_small_patch16_224_ctx_product_50_shared_k(pretrained=False, **kwargs):
    # DeiT-Small with relative position encoding (Contextual Product method)
    rpe_config = get_rpe_config(
        ratio=1.9,
        method=METHOD.PRODUCT,
        mode='ctx',
        shared_head=True,
        skip=1,
        rpe_on='k',
    )
    return deit_small_patch16_224(pretrained=pretrained,
                                  rpe_config=rpe_config,
                                  **kwargs)
Ejemplo n.º 3
0
def deit_small_patch16_224_ctx_cross_56_shared_k(pretrained=False, **kwargs):
    # DeiT-Small with relative position encoding (Contextual Cross method)
    rpe_config = get_rpe_config(
        ratio=20,
        method=METHOD.CROSS,
        mode='ctx',
        shared_head=True,
        skip=1,
        rpe_on='k',
    )
    return deit_small_patch16_224(pretrained=pretrained,
                                  rpe_config=rpe_config,
                                  **kwargs)
Ejemplo n.º 4
0
def deit_small_patch16_224_ctx_quant_51_shared_k(pretrained=False, **kwargs):
    # DeiT-Small with relative position encoding (Contextual Quantization method)
    rpe_config = get_rpe_config(
        ratio=33,
        method=METHOD.QUANT,
        mode='ctx',
        shared_head=True,
        skip=1,
        rpe_on='k',
    )
    return deit_small_patch16_224(pretrained=pretrained,
                                  rpe_config=rpe_config,
                                  **kwargs)
Ejemplo n.º 5
0
def deit_small_patch16_224_ctx_euc_20_shared_k(pretrained=False, **kwargs):
    # DeiT-Small with relative position encoding (Contextual Euclidean method)
    rpe_config = get_rpe_config(
        ratio=20,
        method=METHOD.EUCLIDEAN,
        mode='ctx',
        shared_head=True,
        skip=1,
        rpe_on='k',
    )
    return deit_small_patch16_224(pretrained=pretrained,
                                  rpe_config=rpe_config,
                                  **kwargs)
Ejemplo n.º 6
0
def deit_small_patch16_224_ctx_product_50_shared_qkv(pretrained=False,
                                                     **kwargs):
    # DeiT-Small with relative position encoding on queries, keys and values (Contextual Product method)
    rpe_config = get_rpe_config(
        ratio=1.9,
        method="product",
        mode='ctx',
        shared_head=True,
        skip=1,
        rpe_on='qkv',
    )
    return deit_small_patch16_224(pretrained=pretrained,
                                  rpe_config=rpe_config,
                                  **kwargs)