PyramidVig¶
- class mmpretrain.models.backbones.PyramidVig(arch, in_channels=3, k=9, out_indices=-1, act_cfg={'type': 'GELU'}, norm_cfg={'type': 'BN'}, graph_conv_bias=True, graph_conv_type='mr', epsilon=0.2, use_stochastic=False, drop_path=0.0, norm_eval=False, frozen_stages=0, init_cfg=None)[source]¶
Pyramid Vision GNN backbone.
A PyTorch implementation of Vision GNN: An Image is Worth Graph of Nodes.
Modified from the official implementation https://github.com/huawei-noah/Efficient-AI-Backbones/tree/master/vig_pytorch
- Parameters:
arch (str) – Vision GNN architecture, choose from ‘tiny’, ‘small’ and ‘base’.
in_channels (int) – The number of channels of input images. Defaults to 3.
k (int) – The number of KNN’s k. Defaults to 9.
out_indices (Sequence | int) – Output from which stages. Defaults to -1, means the last stage.
act_cfg (dict) – The config of activative functions. Defaults to
dict(type='GELU'))
.norm_cfg (dict) – The config of normalization layers. Defaults to
dict(type='BN')
.graph_conv_bias (bool) – Whether to use bias in the convolution layers in Grapher. Defaults to True.
graph_conv_type (str) – The type of graph convolution,choose from ‘edge’, ‘mr’, ‘sage’ and ‘gin’. Defaults to ‘mr’.
epsilon (float) – Probability of random arrangement in KNN. It only works when
use_stochastic=True
. Defaults to 0.2.use_stochastic (bool) – Whether to use stochastic in KNN. Defaults to False.
drop_path (float) – stochastic depth rate. Default 0.0
norm_eval (bool) – Whether to set the normalization layer to eval mode. Defaults to False.
frozen_stages (int) – Stages to be frozen (all param fixed). Defaults to 0, which means not freezing any parameters.
init_cfg (dict, optional) – The initialization configs. Defaults to None.