Shortcuts

SetAdaptiveMarginsHook

class mmcls.engine.hooks.SetAdaptiveMarginsHook(margin_min=0.05, margin_max=0.5, power=- 0.25)[源代码]

Set adaptive-margins in ArcFaceClsHead based on the power of category-wise count.

A PyTorch implementation of paper Google Landmark Recognition 2020 Competition Third Place Solution. The margins will be \(\text{f}(n) = (marginMax - marginMin) · norm(n^p) + marginMin\). The n indicates the number of occurrences of a category.

参数
  • margin_min (float) – Lower bound of margins. Defaults to 0.05.

  • margin_max (float) – Upper bound of margins. Defaults to 0.5.

  • power (float) – The power of category freqercy. Defaults to -0.25.

before_train(runner)[源代码]

change the margins in ArcFaceClsHead.

参数

(obj (runner) – Runner): Runner.

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

Free document hosting provided by Read the Docs.