summaryrefslogtreecommitdiff
path: root/training
diff options
context:
space:
mode:
Diffstat (limited to 'training')
-rw-r--r--training/conf/criterion/label_smoothing.yaml4
-rw-r--r--training/conf/mapping/word_piece.yaml9
-rw-r--r--training/conf/model/lit_transformer.yaml4
-rw-r--r--training/conf/network/conv_transformer.yaml13
4 files changed, 30 insertions, 0 deletions
diff --git a/training/conf/criterion/label_smoothing.yaml b/training/conf/criterion/label_smoothing.yaml
index e69de29..ee47c59 100644
--- a/training/conf/criterion/label_smoothing.yaml
+++ b/training/conf/criterion/label_smoothing.yaml
@@ -0,0 +1,4 @@
+_target_: text_recognizer.criterion.label_smoothing
+label_smoothing: 0.1
+vocab_size: 1006
+ignore_index: 1002
diff --git a/training/conf/mapping/word_piece.yaml b/training/conf/mapping/word_piece.yaml
new file mode 100644
index 0000000..39e2ba4
--- /dev/null
+++ b/training/conf/mapping/word_piece.yaml
@@ -0,0 +1,9 @@
+_target_: text_recognizer.data.mappings.WordPieceMapping
+num_features: 1000
+tokens: iamdb_1kwp_tokens_1000.txt
+lexicon: iamdb_1kwp_lex_1000.txt
+data_dir: null
+use_words: false
+prepend_wordsep: false
+special_tokens: ["<s>", "<e>", "<p>"]
+extra_symbols: ["\n"]
diff --git a/training/conf/model/lit_transformer.yaml b/training/conf/model/lit_transformer.yaml
new file mode 100644
index 0000000..4e04b85
--- /dev/null
+++ b/training/conf/model/lit_transformer.yaml
@@ -0,0 +1,4 @@
+_target_: text_recognizer.models.transformer.TransformerLitModel
+interval: null
+monitor: val/loss
+ignore_tokens: ["<s>", "<e>", "<p>"]
diff --git a/training/conf/network/conv_transformer.yaml b/training/conf/network/conv_transformer.yaml
new file mode 100644
index 0000000..f72e030
--- /dev/null
+++ b/training/conf/network/conv_transformer.yaml
@@ -0,0 +1,13 @@
+defaults:
+ - encoder: efficientnet
+ - decoder: transformer_decoder
+
+_target_: text_recognizer.networks.conv_transformer.ConvTransformer
+input_dims: [1, 576, 640]
+hidden_dim: 256
+dropout_rate: 0.2
+max_output_len: 682
+num_classes: 1004
+start_token: <s>
+end_token: <e>
+pad_token: <p>