WRN.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:FreezeOut 作者: ajbrock 项目源码 文件源码
def forward(self, x):

        if not self.active:
            self.eval()

        if not self.equalInOut:
            x = self.relu1(self.bn1(x))
        else:
            out = self.relu1(self.bn1(x))
        out = self.relu2(self.bn2(self.conv1(out if self.equalInOut else x)))
        if self.droprate > 0:
            out = F.dropout(out, p=self.droprate, training=self.training)
        out = self.conv2(out)
        out = torch.add(x if self.equalInOut else self.convShortcut(x), out)
        if self.active:
            return out
        else:
            return out.detach()





# note: we call it DenseNet for simple compatibility with the training code.
# similar we call it growthRate instead of widen_factor
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号