From d20802e1f412045f7afa4bd8ac50be3488945e90 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Fri, 9 Jul 2021 00:46:23 +0200 Subject: Working on cnn transformer, continue with predict --- .../networks/transformer/positional_encodings/__init__.py | 6 +++++- .../networks/transformer/positional_encodings/rotary_embedding.py | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'text_recognizer/networks/transformer') diff --git a/text_recognizer/networks/transformer/positional_encodings/__init__.py b/text_recognizer/networks/transformer/positional_encodings/__init__.py index 91278ee..2ed8a12 100644 --- a/text_recognizer/networks/transformer/positional_encodings/__init__.py +++ b/text_recognizer/networks/transformer/positional_encodings/__init__.py @@ -1,4 +1,8 @@ """Positional encoding for transformers.""" from .absolute_embedding import AbsolutePositionalEmbedding -from .positional_encoding import PositionalEncoding, PositionalEncoding2D +from .positional_encoding import ( + PositionalEncoding, + PositionalEncoding2D, + target_padding_mask, +) from .rotary_embedding import apply_rotary_pos_emb, RotaryEmbedding diff --git a/text_recognizer/networks/transformer/positional_encodings/rotary_embedding.py b/text_recognizer/networks/transformer/positional_encodings/rotary_embedding.py index 5e80572..41290b4 100644 --- a/text_recognizer/networks/transformer/positional_encodings/rotary_embedding.py +++ b/text_recognizer/networks/transformer/positional_encodings/rotary_embedding.py @@ -5,7 +5,6 @@ Stolen from lucidrains: Explanation of roatary: https://blog.eleuther.ai/rotary-embeddings/ - """ from typing import Tuple -- cgit v1.2.3-70-g09d2