basecls.models.repvgg#
RepVGG Series
RegVGG: “RepVGG: Making VGG-style ConvNets Great Again”
引用
- class basecls.models.repvgg.RepVGGBlock(w_in, w_out, stride=1, groups=1, se_r=0.0, act_name='relu', deploy=False)[源代码]#
基类:
Module
RepVGG Reparamed Block.
- 参数
w_in (
int
) – number of input channels.w_out (
int
) – number of output channels.stride (
int
) – stride of the 2D conv. Default:1
groups (
int
) – number of groups of the 2D conv. Default:1
se_r (
float
) – Squeeze-and-Excitation (SE) ratio. Default:0.0
act_name (
str
) – activation function. Default:"relu"
deploy (
bool
) – fuse branches into a plainConv2d
layer. Default:False
- class basecls.models.repvgg.RepVGG(num_blocks, width_multiplier, head=None, groups=1, se_r=0.0, act_name='relu', deploy=False)[源代码]#
基类:
Module
RepVGG Model.
Use
RepVGG.convert_to_deploy()
to convert a trainingRepVGG
to deploy:model = RepVGG(..., deploy=False) model.load_state_dict(...) _ = RepVGG.convert_to_deploy(model)
- 参数
width_multiplier (
Sequence
[int
]) – RepVGG widths,base_width
is[64, 128, 256, 512]
.head (
Optional
[Mapping
[str
,Any
]]) – head args. Default:None
groups (
Union
[int
,List
[Union
[int
,List
[int
]]]]) – number of groups for blocks. Default:1
se_r (
float
) – Squeeze-and-Excitation (SE) ratio. Default:0.0
act_name (
str
) – activation function. Default:"relu"
deploy (
bool
) – switch a reparamed RepVGG into deploy mode. Default:False