basecls.models.resnet#
ResNet Series
ResNet: “Deep Residual Learning for Image Recognition”
ResNet-D: “Bag of Tricks for Image Classification with Convolutional Neural Networks”
ResNeXt: “Aggregated Residual Transformations for Deep Neural Networks”
Se-ResNet: “Squeeze-and-Excitation Networks”
Wide ResNet: “Wide Residual Networks”
引用
facebookresearch/pycls facebookresearch/pycls
- class basecls.models.resnet.ResBasicBlock(w_in, w_out, stride, bot_mul, se_r, avg_down, drop_path_prob, norm_name, act_name, **kwargs)[源代码]#
基类:
ModuleResidual basic block: x + f(x), f = [3x3 conv, BN, Act] x2.
- class basecls.models.resnet.ResBottleneckBlock(w_in, w_out, stride, bot_mul, group_w, se_r, avg_down, drop_path_prob, norm_name, act_name, **kwargs)[源代码]#
基类:
ModuleResidual bottleneck block: x + f(x), f = 1x1, 3x3, 1x1 [+SE].
- class basecls.models.resnet.ResDeepStem(w_in, w_out, norm_name, act_name, **kwargs)[源代码]#
基类:
ModuleResNet-D stem: [3x3, BN, Act] x3, MaxPool.
- class basecls.models.resnet.ResStem(w_in, w_out, norm_name, act_name, **kwargs)[源代码]#
基类:
ModuleResNet stem: 7x7, BN, Act, MaxPool.
- class basecls.models.resnet.SimpleStem(w_in, w_out, norm_name, act_name, **kwargs)[源代码]#
基类:
ModuleSimple stem: 3x3, BN, Act.
- class basecls.models.resnet.AnyStage(w_in, w_out, stride, depth, block_func, drop_path_prob, **kwargs)[源代码]#
基类:
ModuleAnyNet stage (sequence of blocks w/ the same output shape).
- class basecls.models.resnet.ResNet(stem_name, stem_w, block_name, depths, widths, strides, bot_muls=1.0, group_ws=None, se_r=0.0, avg_down=False, drop_path_prob=0.0, zero_init_final_gamma=False, norm_name='BN', act_name='relu', head=None)[源代码]#
基类:
ModuleResNet model.
- 参数
stem_w (
int) – stem width.depths (
Sequence[int]) – depth for each stage (number of blocks in the stage).widths (
Sequence[int]) – width for each stage (width of each block in the stage).strides (
Sequence[int]) – strides for each stage (applies to the first block of each stage).bot_muls (
Union[float,Sequence[float]]) – bottleneck multipliers for each stage (applies to bottleneck block). Default:1.0group_ws (
Optional[Sequence[int]]) – group widths for each stage (applies to bottleneck block). Default:Nonese_r (
float) – Squeeze-and-Excitation (SE) ratio. Default:0.0drop_path_prob (
float) – drop path probability. Default:0.0zero_init_final_gamma (
bool) – enable zero-initialize or not. Default:Falsenorm_name (
str) – normalization function. Default:"BN"act_name (
str) – activation function. Default:"relu"head (
Optional[Mapping[str,Any]]) – head args. Default:None