zabir-nabil commited on
Commit
c518776
1 Parent(s): c913f51

Create config.py

Browse files
Files changed (1) hide show
  1. config.py +48 -0
config.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+
3
+ debug = True
4
+ image_path = ""
5
+ captions_path = ""
6
+
7
+ dataset_root = "/data/comps"
8
+ train_json = "/data/comps/train.json"
9
+ val_json = "/data/comps/val.json"
10
+
11
+
12
+ batch_size = 200
13
+ num_workers = 5
14
+ head_lr = 1e-3
15
+ image_encoder_lr = 1e-4
16
+ text_encoder_lr = 1e-5
17
+ weight_decay = 1e-3
18
+ patience = 2
19
+ factor = 0.8
20
+ epochs = 350
21
+
22
+ gpu = 1
23
+ device = torch.device(f"cuda:{gpu}" if torch.cuda.is_available() else "cpu")
24
+
25
+ model_name = 'efficientnet_b2'
26
+ image_embedding = 1408
27
+
28
+ # model_name = 'resnet50'
29
+ # image_embedding = 1000
30
+
31
+ text_encoder_model = "neuralspace-reverie/indic-transformers-bn-bert"
32
+ text_tokenizer = "neuralspace-reverie/indic-transformers-bn-bert"
33
+ max_length = 100
34
+
35
+ model_tag = f"{model_name}_{text_encoder_model.replace('/', '_')}_aug"
36
+ log_tag = model_tag
37
+
38
+ pretrained = True # for both image encoder and text encoder
39
+ trainable = True # for both image encoder and text encoder
40
+ temperature = 1.0
41
+
42
+ # image size
43
+ size = 224
44
+
45
+ # proj. head
46
+ num_projection_layers = 1
47
+ projection_dim = 256
48
+ dropout = 0.1