summaryrefslogtreecommitdiff
path: root/training/conf/experiment/conv_transformer_paragraphs.yaml
blob: 1465e629806609814bef03fac6f46f7d1e3a4324 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# @package _global_

defaults:
  - override /mapping: characters
  - override /criterion: cross_entropy
  - override /callbacks: htr
  - override /datamodule: iam_extended_paragraphs
  - override /network: conv_transformer
  - override /model: lit_transformer
  - override /lr_schedulers: null
  - override /optimizers: null

epochs: &epochs 629
ignore_index: &ignore_index 3
summary: [[1, 1, 576, 640], [1, 682]]

criterion:
  ignore_index: *ignore_index
  # label_smoothing: 0.1

callbacks:
  stochastic_weight_averaging:
    _target_: pytorch_lightning.callbacks.StochasticWeightAveraging
    swa_epoch_start: 0.75
    swa_lrs: 1.0e-5
    annealing_epochs: 10
    annealing_strategy: cos
    device: null

optimizers:
  radam:
    _target_: torch.optim.RAdam
    lr: 1.5e-4
    betas: [0.9, 0.999]
    weight_decay: 0
    eps: 1.0e-8
    parameters: network

lr_schedulers:
  network:
    _target_: torch.optim.lr_scheduler.ReduceLROnPlateau
    mode: min
    factor: 0.5
    patience: 10
    threshold: 1.0e-4
    threshold_mode: rel
    cooldown: 0
    min_lr: 1.0e-6
    eps: 1.0e-8
    verbose: false
    interval: epoch
    monitor: val/loss

datamodule:
  batch_size: 6
  train_fraction: 0.9

trainer:
  max_epochs: *epochs