Shortcuts

DenseCLNeck

class mmpretrain.models.necks.DenseCLNeck(in_channels, hid_channels, out_channels, num_grid=None, init_cfg=None)[源代码]

The non-linear neck of DenseCL.

Single and dense neck in parallel: fc-relu-fc, conv-relu-conv. Borrowed from the authors’ code.

参数:
  • in_channels (int) – Number of input channels.

  • hid_channels (int) – Number of hidden channels.

  • out_channels (int) – Number of output channels.

  • num_grid (int) – The grid size of dense features. Defaults to None.

  • init_cfg (dict or list[dict], optional) – Initialization config dict. Defaults to None.

forward(x)[源代码]

Forward function of neck.

参数:

x (Tuple[torch.Tensor]) – feature map of backbone.

返回:

  • avgpooled_x: Global feature vectors.

  • x: Dense feature vectors.

  • avgpooled_x2: Dense feature vectors for queue.

返回类型:

Tuple[torch.Tensor, torch.Tensor, torch.Tensor]

Read the Docs v: latest
Versions
latest
stable
mmcls-1.x
mmcls-0.x
dev
Downloads
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.