pytorch 学习

可以看https://github.com/yunjey/pytorch-tutorial 的代码。

其中,https://github.com/yunjey/pytorch-tutorial/blob/master/tutorials/02-intermediate/deep_residual_network/main.py 这份代码里的57行:self.bn1 = nn.BatchNorm2d(out_channels),括号里是out_channels是因为torch.nn.BatchNorm2d(num_features, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)的num_features即输入特征图(N,C,H,W)中的C。154行:model.eval() 是因为Batch Normalization 和 Dropout 在网络训练和测试时采用不同方式。

 

posted on 2019-06-17 17:15  大老虎🐯  阅读(111)  评论(0编辑  收藏  举报