From 2ee92b968a93ef2afb6932e401824a110880e760 Mon Sep 17 00:00:00 2001 From: daidaiershidi <1154864382@qq.com> Date: Mon, 19 Sep 2022 17:07:51 +0800 Subject: [PATCH] [fix] Add and correct docstring --- mmselfsup/datasets/pipelines/transforms.py | 3 ++- mmselfsup/models/algorithms/maskfeat.py | 4 ++++ mmselfsup/models/heads/maskfeat_head.py | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mmselfsup/datasets/pipelines/transforms.py b/mmselfsup/datasets/pipelines/transforms.py index 405f165c1..2168a4a92 100644 --- a/mmselfsup/datasets/pipelines/transforms.py +++ b/mmselfsup/datasets/pipelines/transforms.py @@ -496,9 +496,10 @@ class MaskfeatMaskGenerator(object): min_num_patches (int): Minimum number of patches that require masking. Defaults to 15. max_num_patches (int, optional): Maximum number of patches that - require masking. + require masking. Defaults to None. min_aspect (int): Minimum aspect of patches. Defaults to 0.3. max_aspect (float, optional): Maximum aspect of patches. + Defaults to None. """ def __init__( diff --git a/mmselfsup/models/algorithms/maskfeat.py b/mmselfsup/models/algorithms/maskfeat.py index 06aa3f21a..3bab6bd64 100644 --- a/mmselfsup/models/algorithms/maskfeat.py +++ b/mmselfsup/models/algorithms/maskfeat.py @@ -18,6 +18,10 @@ class MaskFeat(BaseModel): backbone (dict): Config dict for encoder. Defaults to None. head (dict): Config dict for loss functions. Defaults to None. hog_para (dict): Config dict for hog layer. Defaults to None. + dict['nbins', int]: Number of bin. Defaults to 9. + dict['pool', float]: Number of cell. Defaults to 8. + dict['gaussian_window', int]: Size of gaussian kernel. + Defaults to 16. init_cfg (dict): Config dict for weight initialization. Defaults to None. """ diff --git a/mmselfsup/models/heads/maskfeat_head.py b/mmselfsup/models/heads/maskfeat_head.py index 58eb1f365..b774b84f2 100644 --- a/mmselfsup/models/heads/maskfeat_head.py +++ b/mmselfsup/models/heads/maskfeat_head.py @@ -16,8 +16,6 @@ class MaskFeatPretrainHead(BaseModule): embed_dim (int): The dim of the feature before the classifier head. Defaults to 768. hog_dim (int): The dim of the hog feature. Defaults to 108. - reduction (str): Specifies reduction to apply to the output. - Defaults to "mean" (default) or "none". """ def __init__(self, embed_dim: int = 768, hog_dim: int = 108) -> None: @@ -73,6 +71,8 @@ class MaskFeatFinetuneHead(BaseModule): Args: embed_dim (int): The dim of the feature before the classifier head. num_classes (int): The total classes. Defaults to 1000. + label_smooth_val (float): The degree of label smoothing. + Defaults to 0.1. """ def __init__(self,