fix: potential typo in resnet comments

This commit is contained in:
YangWu1227
2023-07-10 02:34:22 -05:00
parent e8a5febf01
commit 1e0007796d

View File

@ -128,7 +128,7 @@ class ResidualBlock(Module):
self.bn2 = nn.BatchNorm2d(out_channels)
# Shortcut connection should be a projection if the stride length is not $1$
# of if the number of channels change
# or if the number of channels change
if stride != 1 or in_channels != out_channels:
# Projection $W_s x$
self.shortcut = ShortcutProjection(in_channels, out_channels, stride)
@ -210,7 +210,7 @@ class BottleneckResidualBlock(Module):
self.bn3 = nn.BatchNorm2d(out_channels)
# Shortcut connection should be a projection if the stride length is not $1$
# of if the number of channels change
# or if the number of channels change
if stride != 1 or in_channels != out_channels:
# Projection $W_s x$
self.shortcut = ShortcutProjection(in_channels, out_channels, stride)