GeneticAlgorithmPython icon indicating copy to clipboard operation
GeneticAlgorithmPython copied to clipboard

pygad.kerasga

Open hiteshKjindal opened this issue 1 year ago • 1 comments

Hi why pygad.kerasga is much slower compared to pygad.gann? I am using the same model specification (1 Input layer, 2 hidden layers and 1 output layer). Why Keras model runtime is very high? Another question is why we are not using crossover and mutation in Keras example? Are we actually using Genetic algorithm here if both mutation and crossover are disabled? Please help to answer.

hiteshKjindal avatar Apr 27 '24 04:04 hiteshKjindal

Keras is very slow due to the TensorFlow nature of building and executing the computational graph. If you try PyTorch, it is much faster.

There is no reason that prevents mutation or crossover to be used with training neural networks.

ahmedfgad avatar Jan 07 '25 22:01 ahmedfgad