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'}])[source]

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”);

Parameters
  • 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’)]

Return type

None

forward(x)[source]

Forward propagation of Locality Aware Feedforward module.

Parameters

x (Tensor) – Feature tensor.

Returns

Feature tensor after Locality Aware Feedforward.

Return type

Tensor

Read the Docs v: latest
Versions
latest
stable
v1.0.1
v1.0.0
0.x
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.0
v0.4.1
v0.4.0
v0.3.0
v0.2.1
v0.2.0
v0.1.0
dev-1.x
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.