https://github.com/Randl/DropBlock-pytorch/blob/master/DropBlock.py
官方:
Block_size=7时,获得最高验证集准确性
对Keep_prob值进行线性下降方式(scheduling)可以获得更好效果
Resnet-50的第3,4个block加Drouout比只在第4个block加Drouout更有效
在Resnet-50的卷积层和skip connection都使用Drouout效果更好
import torch
import torch.nn.functional as F
from torch import nn
class DropBlock2D(nn.Module):
r"""Randomly zeroes spatial blocks of the input tensor.
As described in the paper
`DropBlock: A regularization method for convolutional networks`_ ,
dropping whole blocks of feature map allow