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)[源代码]#
基类:
ModuleRepVGG Reparamed Block.
- 参数
w_in (
int) – number of input channels.w_out (
int) – number of output channels.stride (
int) – stride of the 2D conv. Default:1groups (
int) – number of groups of the 2D conv. Default:1se_r (
float) – Squeeze-and-Excitation (SE) ratio. Default:0.0act_name (
str) – activation function. Default:"relu"deploy (
bool) – fuse branches into a plainConv2dlayer. Default:False
- class basecls.models.repvgg.RepVGG(num_blocks, width_multiplier, head=None, groups=1, se_r=0.0, act_name='relu', deploy=False)[源代码]#
基类:
ModuleRepVGG Model.
Use
RepVGG.convert_to_deploy()to convert a trainingRepVGGto deploy:model = RepVGG(..., deploy=False) model.load_state_dict(...) _ = RepVGG.convert_to_deploy(model)
- 参数
width_multiplier (
Sequence[int]) – RepVGG widths,base_widthis[64, 128, 256, 512].head (
Optional[Mapping[str,Any]]) – head args. Default:Nonegroups (
Union[int,List[Union[int,List[int]]]]) – number of groups for blocks. Default:1se_r (
float) – Squeeze-and-Excitation (SE) ratio. Default:0.0act_name (
str) – activation function. Default:"relu"deploy (
bool) – switch a reparamed RepVGG into deploy mode. Default:False