声明:Caffe 系列文章是我们实验室 黄佳斌 大神所写的内部学习文档,已经获得他的授权允许. 本参考资料是在 Ubuntu14.04 版本下进行,并且默认 Caffe 所需的环境已经配置好,下面教大家如何搭建 KaiMing He 的 Residual Network(残差网络). Cite: He K, Zhang X, Ren S, et al. Deep residual learning for image recognition[C]//Proceedings of the IEEE…
import torch as t import torch.nn as nn import torch.nn.functional as F from torchvision import models # 残差快 残差网络公式 a^[L+] = g(a^[L]+z^[L+]) class ResidualBlock(nn.Module): def __init__(self, inchannel, outchannel, stride=, shortcut=None): #shortcut=…