Shortcuts

SetAdaptiveMarginsHook

class mmpretrain.engine.hooks.SetAdaptiveMarginsHook(margin_min=0.05, margin_max=0.5, power=-0.25)[source]

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.

Parameters:
  • 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)[source]

change the margins in ArcFaceClsHead.

Parameters:

(obj (runner) – Runner): Runner.

Read the Docs v: stable
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.