Shortcuts

Adaptive2DPositionalEncoding

class mmocr.models.textrecog.Adaptive2DPositionalEncoding(d_hid=512, n_height=100, n_width=100, dropout=0.1, init_cfg=[{'type': 'Xavier', 'layer': 'Conv2d'}])[源代码]

Implement Adaptive 2D positional encoder for SATRN, see `SATRN.

<https://arxiv.org/abs/1910.04396>`_ Modified from https://github.com/Media-Smart/vedastr Licensed under the Apache License, Version 2.0 (the “License”);

参数
  • d_hid (int) – Dimensions of hidden layer. Defaults to 512.

  • n_height (int) – Max height of the 2D feature output. Defaults to 100.

  • n_width (int) – Max width of the 2D feature output. Defaults to 100.

  • dropout (float) – Dropout rate. Defaults to 0.1.

  • init_cfg (dict or list[dict], optional) – Initialization configs. Defaults to [dict(type=’Xavier’, layer=’Conv2d’)]

返回类型

None

forward(x)[源代码]

Forward propagation of Locality Aware Feedforward module.

参数

x (Tensor) – Feature tensor.

返回

Feature tensor after Locality Aware Feedforward.

返回类型

Tensor

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

Free document hosting provided by Read the Docs.