-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_genetic.py
42 lines (37 loc) · 1.36 KB
/
main_genetic.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
from dataset import Dataset
from scalers.StandardScaler import StandardScaler
from Preprocessing.Split import Split
from Genetic import Genetic
import Protodeep as pdt
if __name__ == "__main__":
dataset = Dataset('data.csv', 0.2)
scaler = StandardScaler().fit(dataset.features)
dataset.features = scaler.transform(dataset.features)
scaler.save()
((x_train, y_train), (x_test, y_test)) = Split.train_test_split(
dataset.features, dataset.targets)
print(pdt.activations.__all__[:-1])
gen = Genetic(
constraints=[
{
'unit': [20, 80],
'fa': ['linear', 'relu', 'sigmoid', 'softmax', 'tanh'],
'initializer': ['GlorotNormal', 'GlorotUniform', 'HeNormal', 'RandomNormal'],
'regularizer': [None]
},
{
'unit': [10, 30],
'fa': ['linear', 'relu', 'sigmoid', 'softmax', 'tanh'],
'initializer': ['GlorotNormal', 'GlorotUniform', 'HeNormal', 'RandomNormal'],
'regularizer': [None]
},
{
'unit': [2],
'fa': ['softmax'],
'initializer': ['GlorotNormal', 'GlorotUniform', 'HeNormal', 'RandomNormal'],
'regularizer': [None]
}
],
dataset=dataset
)
model = gen.find_model()