You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HI, i am trying to design a simple module of strip pooling for my network. Would you please give me suggestions is it ok or i have to make changes in some places thanks in advance.
class StripPooling(nn.Module):
def init(self, pool_sizes):
super(StripPooling, self).init()
self.pool_sizes = pool_sizes
def forward(self, x):
h, w = x.shape[2:]
k_sizes = []
strides = []
for pool_size in self.pool_sizes:
k_sizes.append((int(h / pool_size), int(w / pool_size)))
strides.append((int(h / pool_size), int(w / pool_size)))
sp_sum = x
for i in range(len(self.pool_sizes)):
out = F.avg_pool2d(x, k_sizes[i], stride=strides[i], padding=0)
out = F.upsample(out, size=(h, w), mode="bilinear")
sp_sum = sp_sum + out
return sp_sum
The text was updated successfully, but these errors were encountered:
HI, i am trying to design a simple module of strip pooling for my network. Would you please give me suggestions is it ok or i have to make changes in some places thanks in advance.
class StripPooling(nn.Module):
def init(self, pool_sizes):
super(StripPooling, self).init()
self.pool_sizes = pool_sizes
The text was updated successfully, but these errors were encountered: