class documentation
class DAT(nn.Module): (source)
Constructor: DAT(img_size, in_chans, embed_dim, split_size, ...)
Dual Aggregation Transformer
| Parameters | |
| img | Input image size. Default: 64 |
| in | Number of input image channels. Default: 3 |
| embed | Patch embedding dimension. Default: 180 |
| depths | Depth of each residual group (number of DATB in each RG). |
| split | Height and Width of spatial window. |
| num | Number of attention heads in different residual groups. |
| expansion | Ratio of ffn hidden dim to embedding dim. Default: 4 |
| qkv | If True, add a learnable bias to query, key, value. Default: True |
| qk | Override default qk scale of head_dim ** -0.5 if set. Default: None |
| drop | Dropout rate. Default: 0 |
| attn | Attention dropout rate. Default: 0 |
| drop | Stochastic depth rate. Default: 0.1 |
| act | Activation layer. Default: nn.GELU |
| norm | Normalization layer. Default: nn.LayerNorm |
| use | Whether to use checkpointing to save memory. |
| upscale | Upscale factor. 2/3/4 for image SR |
| img | Image range. 1. or 255. |
| resi | The convolutional block before residual connection. '1conv'/'3conv' |
| Method | __init__ |
Undocumented |
| Method | forward |
Input: x: (B, C, H, W) |
| Method | forward |
Undocumented |
| Class Variable | hyperparameters |
Undocumented |
| Instance Variable | before_ |
Undocumented |
| Instance Variable | conv |
Undocumented |
| Instance Variable | conv |
Undocumented |
| Instance Variable | conv |
Undocumented |
| Instance Variable | conv |
Undocumented |
| Instance Variable | embed |
Undocumented |
| Instance Variable | img |
Undocumented |
| Instance Variable | layers |
Undocumented |
| Instance Variable | mean |
Undocumented |
| Instance Variable | norm |
Undocumented |
| Instance Variable | num |
Undocumented |
| Instance Variable | num |
Undocumented |
| Instance Variable | upsample |
Undocumented |
| Instance Variable | upsampler |
Undocumented |
| Instance Variable | upscale |
Undocumented |
| Instance Variable | use |
Undocumented |
| Method | _init |
Undocumented |
def __init__(self, *, img_size=64, in_chans=3, embed_dim=180, split_size=[ 2, 4], depth=[ 2, 2, 2, 2], num_heads=[ 2, 2, 2, 2], expansion_factor=4.0, qkv_bias=True, qk_scale:
float|None = None, drop_rate=0.0, attn_drop_rate=0.0, drop_path_rate=0.1, act_layer=nn.GELU, norm_layer=nn.LayerNorm, use_chk=False, upscale=2, img_range=1.0, resi_connection='1conv', upsampler='pixelshuffle'):
(source)
¶
Undocumented