def decode(self, x, test=False, sigmoid=True):
activate = F.relu
# Hidden
h = x
for i in range(self.n_layers_dec - 1):
h = getattr(self, "dec_layer_%i" % i)(h)
h = getattr(self, "dec_batchnorm_%i" % i)(h, test=test)
h = activate(h)
if self.dropout:
h = F.dropout(h, train=not test)
# Output
output = getattr(self, "dec_layer_out")(h)
if sigmoid:
output = F.sigmoid(output)
return output
model.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录