参考:https://blog.csdn.net/qq_14845119/article/details/85103503
正则化方法之DropBlock
论文:
DropBlock: A regularization method for convolutional networks
Github:
https://github.com/miguelvr/dropblock
Install directly from PyPI:
pip install dropblock
or the bleeding edge version from github:
pip install git+https://github.com/miguelvr/dropblock.git#egg=dropblock
NOTE: Implementation and tests were done in Python 3.6, if you have problems with other versions of python please open an issue.
Usage
For 2D inputs (DropBlock2D):
import torch from dropblock import DropBlock2D # (bsize, n_feats, height, width) x = torch.rand(100, 10, 16, 16) drop_block = DropBlock2D(block_size=3, drop_prob=0.3) regularized_x = drop_b