Relative Content

Tag Archive for deep-learningpytorchcomputer-visionconv-neural-network

Probabilistic Forward Function

class ResidualDrop(nn.Module): def __init__(self, nChannels, interm_channel, nOutChannels, deathRate=0.0, stride=1, ): super(ResidualDrop, self).__init__() self.deathRate = deathRate self.conv1 = nn.Conv2d(nChannels, interm_channel, kernel_size=3, stride=stride, padding=1) self.bn1 = nn.BatchNorm2d(interm_channel) self.relu = nn.ReLU(inplace=True) self.conv2 = nn.Conv2d(interm_channel, nOutChannels, kernel_size=3, stride=1, padding=1) self.bn2 = nn.BatchNorm2d(nOutChannels) self.skip = nn.Sequential() if stride != 1 or nOutChannels != nChannels: self.skip = nn.Sequential( nn.Conv2d(nChannels, nOutChannels, kernel_size=1, […]