Ahmed Gad
Ahmed Gad
Thank you! This issue is resolved in a recent commit. Please update to PyGAD 3.3.1.
Thanks to https://stackoverflow.com/a/75606666/5426539. Keras is not thread-safe. The issue can be simply solved by cloning the model before calling the `predict()` method. ```python model = ... _model = tensorflow.keras.models.clone_model(model) predictions...
This is a working example. ```python import pygad import numpy function_inputs = [4,-2,3.5,5,-11,-4.7] # Function inputs. desired_output = 44 # Function output. def fitness_func(ga_instance, solution, solution_idx): output = numpy.sum(solution*function_inputs) fitness...
In the code, I tried calling the `run()` method in a loop and it is still working without exceptions. ```python for i in range(5): ga_instance.run() ```
Hello, Yes, you can. The population is saved into the `population` attribute of the `pygad.GA` instance. You can get and set it at any time. If you wish to replace...
Yes, you can do the same after loading the saved file. It is expected to see some errors after changing the population size. This is because there are other variables...
The new release will disable printing the epochs log messages. This happens when calling the `keras.predict()` method. This commit has the solution https://github.com/ahmedfgad/GeneticAlgorithmPython/commit/0fe7e245239d4e7e630f8ffcc4cdb97d8ba6ecb1 Right now there is no way to...
Not clear if the image restoration is done using GA or you only need to use the GA to only optimize the 2 parameters.
Hi @AndreyKolomiets, Since such issues cannot easily reproduced without having a full working code, I appreciate if you would share a sample that reproduces the issue. This will heavily help...
Hi @rucky96, Thanks for your suggestion. Each process has its own memory that is not shared by the other processes. So, any changes to the population inside a child process...