Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why does imagenet need drop blox size 5 but cifar need dropbox size 2? #38

Open
brando90 opened this issue Jan 16, 2023 · 0 comments
Open

Comments

@brando90
Copy link

def get_resnet_rfs_model_mi(model_opt: str,
                            avg_pool=True,
                            drop_rate=0.1,
                            dropblock_size=5,
                            num_classes=64,
                            ) -> tuple[nn.Module, dict]:
    """
    Get resnet_rfs model according to the string model_opt
        e.g. model_opt = resnet12

    ref:
        - https://github.com/WangYueFt/rfs/blob/f8c837ba93c62dd0ac68a2f4019c619aa86b8421/models/util.py#L7
    """
    model_hps: dict = {'avg_pool': avg_pool,
                       'drop_rate': drop_rate,
                       'dropblock_size': dropblock_size,
                       'num_classes': num_classes}
    model: nn.Module = model_dict[model_opt](avg_pool=avg_pool,
                                             drop_rate=drop_rate,
                                             dropblock_size=dropblock_size,
                                             num_classes=num_classes)
    return model, model_hps


def get_resnet_rfs_model_cifarfs_fc100(model_opt: str,
                                       num_classes,
                                       avg_pool=True,
                                       drop_rate=0.1,
                                       dropblock_size=2,
                                       ) -> tuple[nn.Module, dict]:
    """
    ref:
        - https://github.com/WangYueFt/rfs/blob/f8c837ba93c62dd0ac68a2f4019c619aa86b8421/models/util.py#L7
    """
    model_hps: dict = {'avg_pool': avg_pool,
                       'drop_rate': drop_rate,
                       'dropblock_size': dropblock_size,
                       'num_classes': num_classes}
    model: nn.Module = model_dict[model_opt](avg_pool=avg_pool,
                                             drop_rate=drop_rate,
                                             dropblock_size=dropblock_size,
                                             num_classes=num_classes)
    return model, model_hps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant