def __call__(self, x, test):
if self.sample=="down" or self.sample=="none" or self.sample=='none-9' or self.sample=='none-7' or self.sample=='none-5':
h = self.c(x)
elif self.sample=="up":
h = F.unpooling_2d(x, 2, 2, 0, cover_all=False)
h = self.c(h)
else:
print("unknown sample method %s"%self.sample)
if self.bn:
h = self.batchnorm(h, test=test)
if self.noise:
h = add_noise(h, test=test)
if self.dropout:
h = F.dropout(h, train=not test)
if not self.activation is None:
h = self.activation(h)
return h
评论列表
文章目录