-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.py
46 lines (42 loc) · 1.59 KB
/
config.py
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
# efficientnetv2-m:2152, #efficientnetb2: 1408, #efficientnetv2-s: 1792
# vit_base_patch16_224: 768, vit_base_patch32_224_in21k: 768 =>vit_base_patch16_224 better
# swin_base_patch4_window7_224_in22k: 1024
import torch
class CFG:
ensemble = False
noise_injection= True
debug = False
apex = False
max_len = 40 # 40
print_freq = 100
num_workers = 4
model_name = 'swin'
enc_size = 1536 #1024
samp_size = 10
size = 224 # 288 image size
scheduler = 'CosineAnnealingWarmRestarts'
epochs = 15
T_0 = 50
T_max = 4
encoder_lr = 1e-4
decoder_lr = 4e-4
min_lr = 1e-6
batch_size = 16
weight_decay = 1e-6
gradient_accumulation_steps = 1
max_grad_norm = 100
attention_dim = 256
embed_dim = 512 # 512
decoder_dim = 512 # 512
decoder_layers = 2 # number of LSTM layers
dropout = 0.5
seed = 42
n_fold = 4
trn_fold = [2] #0 is best for tokenizer_vi_fix_error_english2
train = True
train_path = '../data/viecap4h-public-train/viecap4h-public-train/'
test_path = '../data/vietcap4h-private-test/vietcap4h-private-test/'
# test_path = '../data/vietcap4h-public-test/'
tokenizer_path = './tokenizers/tokenizer_vi_fix_error_english2.pth'
prev_model = './pretrained_models/swin_fold1_epoch11_best_remove_english_292646.pth'
device = torch.device('cuda:2' if torch.cuda.is_available() else 'cpu')