Update geneticAlgorithm.py
Browse files- geneticAlgorithm.py +2 -6
geneticAlgorithm.py
CHANGED
|
@@ -55,7 +55,7 @@ def fitness_func(solution, solution_idx):
|
|
| 55 |
modelName = ""
|
| 56 |
for x in solution:
|
| 57 |
modelName += f"{str(x)}_"
|
| 58 |
-
IMC.training_model(epochs=
|
| 59 |
IMC.evaluation(labelName=["0","1","2","3","4","5","6","7","8","9"])
|
| 60 |
output = float(IMC.history.history["val_accuracy"][-1])
|
| 61 |
# output = numpy.max(solution)
|
|
@@ -111,8 +111,4 @@ print(ga_instance.initial_population)
|
|
| 111 |
print(ga_instance.run())
|
| 112 |
solution, solution_fitness, solution_idx = ga_instance.best_solution()
|
| 113 |
print("Parameters of the best solution : {solution}".format(solution=solution))
|
| 114 |
-
print("Fitness value of the best solution = {solution_fitness}".format(solution_fitness=solution_fitness))
|
| 115 |
-
|
| 116 |
-
# from whatsapp import FWA
|
| 117 |
-
# fwa = FWA(APIkey="b2d95af932eedb4de92b3496f338aa5f97b36ae0", NoSender="6285157853522", host="http://wa.fianjulio.web.id:81")
|
| 118 |
-
# print(fwa.sendTextMessage(phoneNumber="082136815488", message="Training selesai"))
|
|
|
|
| 55 |
modelName = ""
|
| 56 |
for x in solution:
|
| 57 |
modelName += f"{str(x)}_"
|
| 58 |
+
IMC.training_model(epochs=10, modelName=modelName, optimizer=usedOptimizers, lossFunction=usedLossFunction)
|
| 59 |
IMC.evaluation(labelName=["0","1","2","3","4","5","6","7","8","9"])
|
| 60 |
output = float(IMC.history.history["val_accuracy"][-1])
|
| 61 |
# output = numpy.max(solution)
|
|
|
|
| 111 |
print(ga_instance.run())
|
| 112 |
solution, solution_fitness, solution_idx = ga_instance.best_solution()
|
| 113 |
print("Parameters of the best solution : {solution}".format(solution=solution))
|
| 114 |
+
print("Fitness value of the best solution = {solution_fitness}".format(solution_fitness=solution_fitness))
|
|
|
|
|
|
|
|
|
|
|
|