-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
61 lines (45 loc) · 1.85 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import os
class Config:
def __init__(self):
self.code_address = os.getcwd() + '/'
self.dataset_address = self.code_address + 'Dataset/'
self.dataset_name = 'caltech' # 'caltech' or 'cifar'
self.train_ratio = 0.7 # 0.7, 0.9
self.conv_properties = [(64, 3, 'relu'), (128, 3, 'relu'), (64, 3, 'relu')] # you can add/remove conv layers
self.dense_properties = [(256, 'relu')] # you can add more dense layers
self.pooling = 'max' # 'max' or 'avg'
self.loss = 'sparse_categorical_crossentropy' # 'mse', 'sparse_categorical_crossentropy', 'hinge'
self.optimizer = 'adam' # 'sgd' or 'adam'
self.epoch = 20 # 10, 20, 100
self.batch_size = 16 # 32, 48, 16
self.learning_rate = 0.0003 # 0.0003 for ADAM, 0.001 for SGD
def get_code_address(self):
return self.code_address
def get_dataset_address(self):
return self.dataset_address + self.dataset_name + '/'
def get_dataset_name(self):
return self.dataset_name
def get_image_size(self):
if self.get_dataset_name() == 'caltech':
image_size = 256
elif self.get_dataset_name() == 'cifar':
image_size = 32
return image_size
def get_train_ratio(self):
return self.train_ratio
def get_net_dense_list(self):
return self.dense_properties
def get_net_conv_list(self):
return self.conv_properties
def get_loss_function(self):
return self.loss
def get_optimizer(self):
return self.optimizer
def get_num_epochs(self):
return self.epoch
def get_batch_size(self):
return self.batch_size
def get_pooling(self):
return self.pooling
def get_learning_rate(self):
return self.learning_rate