Skip to content

Commit

Permalink
update UNet
Browse files Browse the repository at this point in the history
  • Loading branch information
pme0 committed Jul 1, 2023
1 parent a293040 commit 0b33c5b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deeplightning/model/unet.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ def forward(self, x, y):
""" x : the input feature map from the expansive path
y : the corresponding feature map from the contracting path
"""
cropped_y = self.crop(y, x)
x = self.upsample(x)
# The following padding is not clear from the paper how it should be
# implemented but it is necessary in order to get to right feature map
# shapes. Should we pad from right or left, top or bottom?
x = F.pad(x, (0, 1, 0, 1))
x = self.upconv(x)
x = torch.cat((self.crop(y, x), x), dim=1)
x = torch.cat((cropped_y, x), dim=1)
x = self.conv(x)
return x

Expand Down

0 comments on commit 0b33c5b

Please sign in to comment.