mattmacy / vnet.pytorch

A PyTorch implementation for V-Net: Fully Convolutional Neural Networks for Volumetric Medical Image Segmentation
https://mattmacy.github.io/vnet.pytorch
BSD 3-Clause "New" or "Revised" License
688 stars 201 forks source link

The implementation of the decoder is different than the architecture posted here. #19

Open hsu-z2 opened 6 years ago

hsu-z2 commented 6 years ago

In the architecture defined by the code is different than the architecture posed in the webpage: Why is this different? Which one works better? Thank you!

class UpTransition(nn.Module): def init(self, inChans, outChans, nConvs, elu, dropout=False): super(UpTransition, self).init() self.up_conv = nn.ConvTranspose3d(inChans, outChans // 2, kernel_size=2, stride=2) self.bn1 = ContBatchNorm3d(outChans // 2) self.do1 = passthrough self.do2 = nn.Dropout3d() self.relu1 = ELUCons(elu, outChans // 2) self.relu2 = ELUCons(elu, outChans) if dropout: self.do1 = nn.Dropout3d() self.ops = _make_nConv(outChans, nConvs, elu) def forward(self, x, skipx): out = self.do1(x) skipxdo = self.do2(skipx) out = self.relu1(self.bn1(self.up_conv(out))) xcat = torch.cat((out, skipxdo), 1) out = self.ops(xcat) out = self.relu2(torch.add(out, xcat)) return out