-
Notifications
You must be signed in to change notification settings - Fork 270
/
params.py
82 lines (65 loc) · 2.61 KB
/
params.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
def titanic(debug=False):
from tensorflow.keras.optimizers import Adam, Nadam
# here use a standard 2d dictionary for inputting the param boundaries
p = {'lr': (0.5, 5, 10),
'first_neuron': [4, 8, 16],
'batch_size': [20, 30, 40],
'dropout': (0, 0.5, 5),
'optimizer': [Adam(), Nadam()],
'epochs': [50, 100, 150],
'losses': ['logcosh', 'binary_crossentropy'],
'shapes': ['brick', 'triangle', 0.2],
'hidden_layers': [0, 1, 2, 3, 4],
'activation': ['relu', 'elu'],
'last_activation': ['sigmoid']}
if debug:
p = {'lr': [0.1, 0.2],
'first_neuron': [4, 8],
'batch_size': [20, 30],
'dropout': [0.2, 0.3],
'optimizer': [Adam(), Nadam()],
'epochs': [50, 100],
'losses': ['logcosh', 'binary_crossentropy'],
'shapes': ['brick', 'triangle', 0.2],
'hidden_layers': [0, 1],
'activation': ['relu', 'elu'],
'last_activation': ['sigmoid']}
return p
def iris():
from tensorflow.keras.optimizers import Adam, Nadam
from tensorflow.keras.losses import logcosh, categorical_crossentropy
from tensorflow.keras.activations import relu, elu, softmax
# here use a standard 2d dictionary for inputting the param boundaries
p = {'lr': (0.5, 5, 10),
'first_neuron': [4, 8, 16, 32, 64],
'hidden_layers': [0, 1, 2, 3, 4],
'batch_size': (2, 30, 10),
'epochs': [50, 100, 150],
'dropout': (0, 0.5, 5),
'weight_regulizer': [None],
'emb_output_dims': [None],
'shapes': ['brick', 'triangle', 0.2],
'optimizer': [Adam, Nadam],
'losses': [logcosh, categorical_crossentropy],
'activation': [relu, elu],
'last_activation': [softmax]}
return p
def breast_cancer():
from tensorflow.keras.optimizers import Adam, Nadam, RMSprop
from tensorflow.keras.losses import logcosh, binary_crossentropy
from tensorflow.keras.activations import relu, elu, sigmoid
# then we can go ahead and set the parameter space
p = {'lr': (0.5, 5, 10),
'first_neuron': [4, 8, 16, 32, 64],
'hidden_layers': [0, 1, 2],
'batch_size': (2, 30, 10),
'epochs': [50, 100, 150],
'dropout': (0, 0.5, 5),
'shapes': ['brick', 'triangle', 'funnel'],
'optimizer': [Adam, Nadam, RMSprop],
'losses': [logcosh, binary_crossentropy],
'activation': [relu, elu],
'last_activation': [sigmoid]}
return p
def cervical_cancer():
return breast_cancer()