From 4e60c836fb710baceba570c28c06437db3ad5c9b Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sat, 24 Apr 2021 23:09:20 +0200 Subject: Implementing CoaT transformer, continue tomorrow... --- text_recognizer/networks/coat/factor_attention.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 text_recognizer/networks/coat/factor_attention.py (limited to 'text_recognizer/networks/coat/factor_attention.py') diff --git a/text_recognizer/networks/coat/factor_attention.py b/text_recognizer/networks/coat/factor_attention.py new file mode 100644 index 0000000..f91c5ef --- /dev/null +++ b/text_recognizer/networks/coat/factor_attention.py @@ -0,0 +1,9 @@ +"""Factorized attention with convolutional relative positional encodings.""" +from torch import nn + + +class FactorAttention(nn.Module): + """Factorized attention with relative positional encodings.""" + def __init__(self, dim: int, num_heads: int) -> None: + pass + -- cgit v1.2.3-70-g09d2