-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
38 lines (28 loc) · 958 Bytes
/
Copy pathmain.py
File metadata and controls
38 lines (28 loc) · 958 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
38
from algo_genetique import algo_genetique, algo_genetique_opti_model
from CNN_classe import Classifier
def main():
nb_generations = 70
nb_models = 100
nb_couches = 2
nb_select = 25
nb_crois = 25
nb_mut = 50
best_model = algo_genetique(nb_generations, nb_models, nb_couches, nb_select, nb_crois, nb_mut)
print("fin de la simulation")
return 0
def algo_autour_model(model : Classifier):
"""
Au lieu de faire un simulation qui par entièrement de modèles randoms, on va partir d'un modèle existant,
le faire muter et l'optimiser seulement avec l'algo génétique,
"""
nb_generations = 25
nb_model = 50
nb_select = 15
nb_crois = 20
nb_mut = 15
list_model = algo_genetique_opti_model(nb_generations, model, nb_select, nb_crois, nb_mut, nb_model)
main()
"""
model = Classifier([[32, 3, 0.2], [64, 3, 0.2],[128, 3, 0.2],[256, 3, 0.2]])
algo_autour_model(model)
"""