-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
37 lines (19 loc) · 912 Bytes
/
Copy pathconfig.py
File metadata and controls
37 lines (19 loc) · 912 Bytes
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
import time
class Config:
labels = ["pre1935", "1935-1955", "1956-1971", "1972-1990", "post1990"]
num_classes = len(labels)
image_size = 224
input_shape = [image_size, image_size, 3]
lr_max = 5e-5 # maximum learning rate
lr_min = 1e-6 # minimum learning rate, note you can set lr_min = lr_max to use constant learning rate
optimizer = "adam" # 'adam' or 'sgd'
early_stop_patience = 10
transfer_learning = 1 # 1 if transfer learning is used, 0 otherwise
batch_size = 64 # higher batch size is faster but requires more memory
num_epochs = 100 # max number of epochs
loss = "crossentropy"
val = 1 # 1 if validation input is available, 0 otherwise
saved_model_dir = "weights/run3/" # leave empty to defaul model
in_dir = "input/run3/"
timestr = str(time.strftime("%Y%m%d-%H%M%S"))
out_dir = "output/" + str(timestr) + "/"