Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion segmentation_models_pytorch/base/heads.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def __init__(
in_channels, out_channels, kernel_size=kernel_size, padding=kernel_size // 2
)
upsampling = (
nn.UpsamplingBilinear2d(scale_factor=upsampling)
nn.Upsample(mode="bilinear", scale_factor=upsampling)
if upsampling > 1
else nn.Identity()
)
Expand Down
2 changes: 1 addition & 1 deletion segmentation_models_pytorch/decoders/deeplabv3/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def __init__(
)

scale_factor = 4 if output_stride == 16 and encoder_depth > 3 else 2
self.up = nn.UpsamplingBilinear2d(scale_factor=scale_factor)
self.up = nn.Upsample(mode="bilinear", scale_factor=scale_factor)

highres_in_channels = encoder_channels[2]
highres_out_channels = 48 # proposed by authors of paper
Expand Down
2 changes: 1 addition & 1 deletion segmentation_models_pytorch/losses/_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def wing_loss(
idx_smaller = diff_abs < width
idx_bigger = diff_abs >= width

loss[idx_smaller] = width * torch.log(1 + diff_abs[idx_smaller] / curvature)
loss[idx_smaller] = width * torch.log1p(diff_abs[idx_smaller] / curvature)

C = width - width * math.log(1 + width / curvature)
loss[idx_bigger] = loss[idx_bigger] - C
Expand Down
Loading