{"id":20703213,"url":"https://github.com/ahmedfgad/torchga","last_synced_at":"2025-03-23T07:07:28.965Z","repository":{"id":39994655,"uuid":"326429046","full_name":"ahmedfgad/TorchGA","owner":"ahmedfgad","description":"Train PyTorch Models using the Genetic Algorithm with PyGAD","archived":false,"fork":false,"pushed_at":"2024-09-21T14:41:06.000Z","size":3234,"stargazers_count":97,"open_issues_count":2,"forks_count":15,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-15T06:15:04.106Z","etag":null,"topics":["cnn","deep-learning","evolutionary-algorithms","genetic-algorithm","machine-learning","neural-networks","neuroscience","pygad","python","pytorch","torch"],"latest_commit_sha":null,"homepage":"https://pygad.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ahmedfgad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"open_collective":"pygad","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://donate.stripe.com/eVa5kO866elKgM0144","http://paypal.me/ahmedfgad"]}},"created_at":"2021-01-03T14:42:52.000Z","updated_at":"2024-12-23T12:20:09.000Z","dependencies_parsed_at":"2025-01-16T20:08:41.996Z","dependency_job_id":"c89cb3ca-3327-4dab-a318-95cc4e708f98","html_url":"https://github.com/ahmedfgad/TorchGA","commit_stats":{"total_commits":20,"total_committers":2,"mean_commits":10.0,"dds":0.09999999999999998,"last_synced_commit":"ffd28f7e2d35adc4e8438697057d828396dda3c1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedfgad%2FTorchGA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedfgad%2FTorchGA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedfgad%2FTorchGA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedfgad%2FTorchGA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmedfgad","download_url":"https://codeload.github.com/ahmedfgad/TorchGA/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245066676,"owners_count":20555427,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cnn","deep-learning","evolutionary-algorithms","genetic-algorithm","machine-learning","neural-networks","neuroscience","pygad","python","pytorch","torch"],"created_at":"2024-11-17T01:06:46.762Z","updated_at":"2025-03-23T07:07:28.938Z","avatar_url":"https://github.com/ahmedfgad.png","language":"Python","funding_links":["https://opencollective.com/pygad","https://donate.stripe.com/eVa5kO866elKgM0144","http://paypal.me/ahmedfgad","https://paypal.me/ahmedfgad"],"categories":[],"sub_categories":[],"readme":"# TorchGA: Training PyTorch Models using the Genetic Algorithm\n[TorchGA](https://github.com/ahmedfgad/TorchGA) is part of the [PyGAD](https://pypi.org/project/pygad) library for training [PyTorch](https://pytorch.org) models using the genetic algorithm (GA). This feature is supported starting from [PyGAD](https://pypi.org/project/pygad) 2.10.0. \n\nThe [TorchGA](https://github.com/ahmedfgad/TorchGA) project has a single module named `torchga.py` which has a class named `TorchGA` for preparing an initial population of PyTorch model parameters.\n\n[PyGAD](https://pypi.org/project/pygad) is an open-source Python library for building the genetic algorithm and training machine learning algorithms. Check the library's documentation at [Read The Docs](https://pygad.readthedocs.io/): https://pygad.readthedocs.io\n\n# Donation\n\n- [Credit/Debit Card](https://donate.stripe.com/eVa5kO866elKgM0144): https://donate.stripe.com/eVa5kO866elKgM0144\n- [Open Collective](https://opencollective.com/pygad): [opencollective.com/pygad](https://opencollective.com/pygad)\n- PayPal: Use either this link: [paypal.me/ahmedfgad](https://paypal.me/ahmedfgad) or the e-mail address ahmed.f.gad@gmail.com\n- Interac e-Transfer: Use e-mail address ahmed.f.gad@gmail.com\n\n# Installation\n\nTo install [PyGAD](https://pypi.org/project/pygad), simply use pip to download and install the library from [PyPI](https://pypi.org/project/pygad) (Python Package Index). The library lives a PyPI at this page https://pypi.org/project/pygad.\n\n```python\npip3 install pygad\n```\n\nTo get started with PyGAD, please read the documentation at [Read The Docs](https://pygad.readthedocs.io/) https://pygad.readthedocs.io.\n\n# PyGAD Source Code\n\nThe source code of the `PyGAD` modules is found in the following GitHub projects:\n\n- [pygad](https://github.com/ahmedfgad/GeneticAlgorithmPython): (https://github.com/ahmedfgad/GeneticAlgorithmPython)\n- [pygad.nn](https://github.com/ahmedfgad/NumPyANN): https://github.com/ahmedfgad/NumPyANN\n- [pygad.gann](https://github.com/ahmedfgad/NeuralGenetic): https://github.com/ahmedfgad/NeuralGenetic\n- [pygad.cnn](https://github.com/ahmedfgad/NumPyCNN): https://github.com/ahmedfgad/NumPyCNN\n- [pygad.gacnn](https://github.com/ahmedfgad/CNNGenetic): https://github.com/ahmedfgad/CNNGenetic\n- [pygad.kerasga](https://github.com/ahmedfgad/KerasGA): https://github.com/ahmedfgad/KerasGA\n- [pygad.torchga](https://github.com/ahmedfgad/TorchGA): https://github.com/ahmedfgad/TorchGA\n\nThe documentation of PyGAD is available at [Read The Docs](https://pygad.readthedocs.io/) https://pygad.readthedocs.io.\n\n# PyGAD Documentation\n\nThe documentation of the PyGAD library is available at [Read The Docs](https://pygad.readthedocs.io) at this link: https://pygad.readthedocs.io. It discusses the modules supported by PyGAD, all its classes, methods, attribute, and functions. For each module, a number of examples are given.\n\nIf there is an issue using PyGAD, feel free to post at issue in this [GitHub repository](https://github.com/ahmedfgad/GeneticAlgorithmPython) https://github.com/ahmedfgad/GeneticAlgorithmPython or by sending an e-mail to ahmed.f.gad@gmail.com. \n\nIf you built a project that uses PyGAD, then please drop an e-mail to ahmed.f.gad@gmail.com with the following information so that your project is included in the documentation.\n\n- Project title\n- Brief description\n- Preferably, a link that directs the readers to your project\n\nPlease check the **Contact Us** section for more contact details.\n\n# Life Cycle of PyGAD\n\nThe next figure lists the different stages in the lifecycle of an instance of the `pygad.GA` class. Note that PyGAD stops when either all generations are completed or when the function passed to the `on_generation` parameter returns the string `stop`.\n\n![PyGAD Lifecycle](https://user-images.githubusercontent.com/16560492/89446279-9c6f8380-d754-11ea-83fd-a60ea2f53b85.jpg)\n\nThe next code implements all the callback functions to trace the execution of the genetic algorithm. Each callback function prints its name.\n\n```python\nimport pygad\nimport numpy\n\nfunction_inputs = [4,-2,3.5,5,-11,-4.7]\ndesired_output = 44\n\ndef fitness_func(ga_instance, solution, solution_idx):\n    output = numpy.sum(solution*function_inputs)\n    fitness = 1.0 / (numpy.abs(output - desired_output) + 0.000001)\n    return fitness\n\nfitness_function = fitness_func\n\ndef on_start(ga_instance):\n    print(\"on_start()\")\n\ndef on_fitness(ga_instance, population_fitness):\n    print(\"on_fitness()\")\n\ndef on_parents(ga_instance, selected_parents):\n    print(\"on_parents()\")\n\ndef on_crossover(ga_instance, offspring_crossover):\n    print(\"on_crossover()\")\n\ndef on_mutation(ga_instance, offspring_mutation):\n    print(\"on_mutation()\")\n\ndef on_generation(ga_instance):\n    print(\"on_generation()\")\n\ndef on_stop(ga_instance, last_population_fitness):\n    print(\"on_stop()\")\n\nga_instance = pygad.GA(num_generations=3,\n                       num_parents_mating=5,\n                       fitness_func=fitness_function,\n                       sol_per_pop=10,\n                       num_genes=len(function_inputs),\n                       on_start=on_start,\n                       on_fitness=on_fitness,\n                       on_parents=on_parents,\n                       on_crossover=on_crossover,\n                       on_mutation=on_mutation,\n                       on_generation=on_generation,\n                       on_stop=on_stop)\n\nga_instance.run()\n```\n\nBased on the used 3 generations as assigned to the `num_generations` argument, here is the output.\n\n```\non_start()\n\non_fitness()\non_parents()\non_crossover()\non_mutation()\non_generation()\n\non_fitness()\non_parents()\non_crossover()\non_mutation()\non_generation()\n\non_fitness()\non_parents()\non_crossover()\non_mutation()\non_generation()\n\non_stop()\n```\n\n# Examples\n\nCheck the [PyGAD's documentation](https://pygad.readthedocs.io/en/latest/gacnn.html) for more examples information. You can also find more information about the implementation of the examples.\n\n## Example 1: Regression Model\n\n```python\nimport torch\nimport torchga\nimport pygad\n\ndef fitness_func(ga_instance, solution, sol_idx):\n    global data_inputs, data_outputs, torch_ga, model, loss_function\n\n    model_weights_dict = torchga.model_weights_as_dict(model=model,\n                                                       weights_vector=solution)\n\n    # Use the current solution as the model parameters.\n    model.load_state_dict(model_weights_dict)\n\n    predictions = model(data_inputs)\n    abs_error = loss_function(predictions, data_outputs).detach().numpy() + 0.00000001\n\n    solution_fitness = 1.0 / abs_error\n\n    return solution_fitness\n\ndef callback_generation(ga_instance):\n    print(\"Generation = {generation}\".format(generation=ga_instance.generations_completed))\n    print(\"Fitness    = {fitness}\".format(fitness=ga_instance.best_solution()[1]))\n\n# Create the PyTorch model.\ninput_layer = torch.nn.Linear(3, 5)\nrelu_layer = torch.nn.ReLU()\noutput_layer = torch.nn.Linear(5, 1)\n\nmodel = torch.nn.Sequential(input_layer,\n                            relu_layer,\n                            output_layer)\n# print(model)\n\n# Create an instance of the pygad.torchga.TorchGA class to build the initial population.\ntorch_ga = torchga.TorchGA(model=model,\n                           num_solutions=10)\n\nloss_function = torch.nn.L1Loss()\n\n# Data inputs\ndata_inputs = torch.tensor([[0.02, 0.1, 0.15],\n                            [0.7, 0.6, 0.8],\n                            [1.5, 1.2, 1.7],\n                            [3.2, 2.9, 3.1]])\n\n# Data outputs\ndata_outputs = torch.tensor([[0.1],\n                             [0.6],\n                             [1.3],\n                             [2.5]])\n\n# Prepare the PyGAD parameters. Check the documentation for more information: https://pygad.readthedocs.io/en/latest/pygad.html#pygad-ga-class\nnum_generations = 250 # Number of generations.\nnum_parents_mating = 5 # Number of solutions to be selected as parents in the mating pool.\ninitial_population = torch_ga.population_weights # Initial population of network weights\n\nga_instance = pygad.GA(num_generations=num_generations, \n                       num_parents_mating=num_parents_mating, \n                       initial_population=initial_population,\n                       fitness_func=fitness_func,\n                       on_generation=callback_generation)\n\nga_instance.run()\n\n# After the generations complete, some plots are showed that summarize how the outputs/fitness values evolve over generations.\nga_instance.plot_fitness(title=\"PyGAD \u0026 PyTorch - Iteration vs. Fitness\", linewidth=4)\n\n# Returning the details of the best solution.\nsolution, solution_fitness, solution_idx = ga_instance.best_solution()\nprint(\"Fitness value of the best solution = {solution_fitness}\".format(solution_fitness=solution_fitness))\nprint(\"Index of the best solution : {solution_idx}\".format(solution_idx=solution_idx))\n\n# Fetch the parameters of the best solution.\nbest_solution_weights = torchga.model_weights_as_dict(model=model,\n                                                      weights_vector=solution)\nmodel.load_state_dict(best_solution_weights)\npredictions = model(data_inputs)\nprint(\"Predictions : \\n\", predictions.detach().numpy())\n\nabs_error = loss_function(predictions, data_outputs)\nprint(\"Absolute Error : \", abs_error.detach().numpy())\n```\n\n## Example 2: XOR Binary Classification\n\n```python\nimport torch\nimport torchga\nimport pygad\n\ndef fitness_func(ga_instance, solution, sol_idx):\n    global data_inputs, data_outputs, torch_ga, model, loss_function\n\n    model_weights_dict = torchga.model_weights_as_dict(model=model,\n                                                         weights_vector=solution)\n\n    # Use the current solution as the model parameters.\n    model.load_state_dict(model_weights_dict)\n\n    predictions = model(data_inputs)\n\n    solution_fitness = 1.0 / (loss_function(predictions, data_outputs).detach().numpy() + 0.00000001)\n\n    return solution_fitness\n\ndef callback_generation(ga_instance):\n    print(\"Generation = {generation}\".format(generation=ga_instance.generations_completed))\n    print(\"Fitness    = {fitness}\".format(fitness=ga_instance.best_solution()[1]))\n\n# Create the PyTorch model.\ninput_layer  = torch.nn.Linear(2, 4)\nrelu_layer = torch.nn.ReLU()\ndense_layer = torch.nn.Linear(4, 2)\noutput_layer = torch.nn.Softmax(1)\n\nmodel = torch.nn.Sequential(input_layer,\n                            relu_layer,\n                            dense_layer,\n                            output_layer)\n# print(model)\n\n# Create an instance of the pygad.torchga.TorchGA class to build the initial population.\ntorch_ga = torchga.TorchGA(model=model,\n                           num_solutions=10)\n\nloss_function = torch.nn.BCELoss()\n\n# XOR problem inputs\ndata_inputs = torch.tensor([[0.0, 0.0],\n                            [0.0, 1.0],\n                            [1.0, 0.0],\n                            [1.0, 1.0]])\n\n# XOR problem outputs\ndata_outputs = torch.tensor([[1.0, 0.0],\n                             [0.0, 1.0],\n                             [0.0, 1.0],\n                             [1.0, 0.0]])\n\n# Prepare the PyGAD parameters. Check the documentation for more information: https://pygad.readthedocs.io/en/latest/pygad.html#pygad-ga-class\nnum_generations = 250 # Number of generations.\nnum_parents_mating = 5 # Number of solutions to be selected as parents in the mating pool.\ninitial_population = torch_ga.population_weights # Initial population of network weights.\n\n# Create an instance of the pygad.GA class\nga_instance = pygad.GA(num_generations=num_generations, \n                       num_parents_mating=num_parents_mating, \n                       initial_population=initial_population,\n                       fitness_func=fitness_func,\n                       on_generation=callback_generation)\n\n# Start the genetic algorithm evolution.\nga_instance.run()\n\n# After the generations complete, some plots are showed that summarize how the outputs/fitness values evolve over generations.\nga_instance.plot_fitness(title=\"PyGAD \u0026 PyTorch - Iteration vs. Fitness\", linewidth=4)\n\n# Returning the details of the best solution.\nsolution, solution_fitness, solution_idx = ga_instance.best_solution()\nprint(\"Fitness value of the best solution = {solution_fitness}\".format(solution_fitness=solution_fitness))\nprint(\"Index of the best solution : {solution_idx}\".format(solution_idx=solution_idx))\n\n# Fetch the parameters of the best solution.\nbest_solution_weights = torchga.model_weights_as_dict(model=model,\n                                                      weights_vector=solution)\nmodel.load_state_dict(best_solution_weights)\npredictions = model(data_inputs)\nprint(\"Predictions : \\n\", predictions.detach().numpy())\n\n# Calculate the binary crossentropy for the trained model.\nprint(\"Binary Crossentropy : \", loss_function(predictions, data_outputs).detach().numpy())\n\n# Calculate the classification accuracy of the trained model.\na = torch.max(predictions, axis=1)\nb = torch.max(data_outputs, axis=1)\naccuracy = torch.sum(a.indices == b.indices) / len(data_outputs)\nprint(\"Accuracy : \", accuracy.detach().numpy())\n```\n\n# For More Information\n\nThere are different resources that can be used to get started with the building CNN and its Python implementation. \n\n## Tutorial: Implementing Genetic Algorithm in Python\n\nTo start with coding the genetic algorithm, you can check the tutorial titled [**Genetic Algorithm Implementation in Python**](https://www.linkedin.com/pulse/genetic-algorithm-implementation-python-ahmed-gad) available at these links:\n\n- [LinkedIn](https://www.linkedin.com/pulse/genetic-algorithm-implementation-python-ahmed-gad)\n- [Towards Data Science](https://towardsdatascience.com/genetic-algorithm-implementation-in-python-5ab67bb124a6)\n- [KDnuggets](https://www.kdnuggets.com/2018/07/genetic-algorithm-implementation-python.html)\n\n[This tutorial](https://www.linkedin.com/pulse/genetic-algorithm-implementation-python-ahmed-gad) is prepared based on a previous version of the project but it still a good resource to start with coding the genetic algorithm.\n\n[![Genetic Algorithm Implementation in Python](https://user-images.githubusercontent.com/16560492/78830052-a3c19300-79e7-11ea-8b9b-4b343ea4049c.png)](https://www.linkedin.com/pulse/genetic-algorithm-implementation-python-ahmed-gad)\n\n## Tutorial: Introduction to Genetic Algorithm\n\nGet started with the genetic algorithm by reading the tutorial titled [**Introduction to Optimization with Genetic Algorithm**](https://www.linkedin.com/pulse/introduction-optimization-genetic-algorithm-ahmed-gad) which is available at these links:\n\n* [LinkedIn](https://www.linkedin.com/pulse/introduction-optimization-genetic-algorithm-ahmed-gad)\n* [Towards Data Science](https://www.kdnuggets.com/2018/03/introduction-optimization-with-genetic-algorithm.html)\n* [KDnuggets](https://towardsdatascience.com/introduction-to-optimization-with-genetic-algorithm-2f5001d9964b)\n\n[![Introduction to Genetic Algorithm](https://user-images.githubusercontent.com/16560492/82078259-26252d00-96e1-11ea-9a02-52a99e1054b9.jpg)](https://www.linkedin.com/pulse/introduction-optimization-genetic-algorithm-ahmed-gad)\n\n## Tutorial: Build Neural Networks in Python\n\nRead about building neural networks in Python through the tutorial titled [**Artificial Neural Network Implementation using NumPy and Classification of the Fruits360 Image Dataset**](https://www.linkedin.com/pulse/artificial-neural-network-implementation-using-numpy-fruits360-gad) available at these links:\n\n* [LinkedIn](https://www.linkedin.com/pulse/artificial-neural-network-implementation-using-numpy-fruits360-gad)\n* [Towards Data Science](https://towardsdatascience.com/artificial-neural-network-implementation-using-numpy-and-classification-of-the-fruits360-image-3c56affa4491)\n* [KDnuggets](https://www.kdnuggets.com/2019/02/artificial-neural-network-implementation-using-numpy-and-image-classification.html)\n\n[![Building Neural Networks Python](https://user-images.githubusercontent.com/16560492/82078281-30472b80-96e1-11ea-8017-6a1f4383d602.jpg)](https://www.linkedin.com/pulse/artificial-neural-network-implementation-using-numpy-fruits360-gad)\n\n## Tutorial: Optimize Neural Networks with Genetic Algorithm\n\nRead about training neural networks using the genetic algorithm through the tutorial titled [**Artificial Neural Networks Optimization using Genetic Algorithm with Python**](https://www.linkedin.com/pulse/artificial-neural-networks-optimization-using-genetic-ahmed-gad) available at these links:\n\n- [LinkedIn](https://www.linkedin.com/pulse/artificial-neural-networks-optimization-using-genetic-ahmed-gad)\n- [Towards Data Science](https://towardsdatascience.com/artificial-neural-networks-optimization-using-genetic-algorithm-with-python-1fe8ed17733e)\n- [KDnuggets](https://www.kdnuggets.com/2019/03/artificial-neural-networks-optimization-genetic-algorithm-python.html)\n\n[![Training Neural Networks using Genetic Algorithm Python](https://user-images.githubusercontent.com/16560492/82078300-376e3980-96e1-11ea-821c-aa6b8ceb44d4.jpg)](https://www.linkedin.com/pulse/artificial-neural-networks-optimization-using-genetic-ahmed-gad)\n\n## Tutorial: Building CNN in Python\n\nTo start with coding the genetic algorithm, you can check the tutorial titled [**Building Convolutional Neural Network using NumPy from Scratch**](https://www.linkedin.com/pulse/building-convolutional-neural-network-using-numpy-from-ahmed-gad) available at these links:\n\n- [LinkedIn](https://www.linkedin.com/pulse/building-convolutional-neural-network-using-numpy-from-ahmed-gad)\n- [Towards Data Science](https://towardsdatascience.com/building-convolutional-neural-network-using-numpy-from-scratch-b30aac50e50a)\n- [KDnuggets](https://www.kdnuggets.com/2018/04/building-convolutional-neural-network-numpy-scratch.html)\n- [Chinese Translation](http://m.aliyun.com/yunqi/articles/585741)\n\n[This tutorial](https://www.linkedin.com/pulse/building-convolutional-neural-network-using-numpy-from-ahmed-gad)) is prepared based on a previous version of the project but it still a good resource to start with coding CNNs.\n\n[![Building CNN in Python](https://user-images.githubusercontent.com/16560492/82431022-6c3a1200-9a8e-11ea-8f1b-b055196d76e3.png)](https://www.linkedin.com/pulse/building-convolutional-neural-network-using-numpy-from-ahmed-gad)\n\n## Tutorial: Derivation of CNN from FCNN\n\nGet started with the genetic algorithm by reading the tutorial titled [**Derivation of Convolutional Neural Network from Fully Connected Network Step-By-Step**](https://www.linkedin.com/pulse/derivation-convolutional-neural-network-from-fully-connected-gad) which is available at these links:\n\n* [LinkedIn](https://www.linkedin.com/pulse/derivation-convolutional-neural-network-from-fully-connected-gad)\n* [Towards Data Science](https://towardsdatascience.com/derivation-of-convolutional-neural-network-from-fully-connected-network-step-by-step-b42ebafa5275)\n* [KDnuggets](https://www.kdnuggets.com/2018/04/derivation-convolutional-neural-network-fully-connected-step-by-step.html)\n\n[![Derivation of CNN from FCNN](https://user-images.githubusercontent.com/16560492/82431369-db176b00-9a8e-11ea-99bd-e845192873fc.png)](https://www.linkedin.com/pulse/derivation-convolutional-neural-network-from-fully-connected-gad)\n\n## Book: Practical Computer Vision Applications Using Deep Learning with CNNs\n\nYou can also check my book cited as [**Ahmed Fawzy Gad 'Practical Computer Vision Applications Using Deep Learning with CNNs'. Dec. 2018, Apress, 978-1-4842-4167-7**](https://www.amazon.com/Practical-Computer-Vision-Applications-Learning/dp/1484241665) which discusses neural networks, convolutional neural networks, deep learning, genetic algorithm, and more.\n\nFind the book at these links:\n\n- [Amazon](https://www.amazon.com/Practical-Computer-Vision-Applications-Learning/dp/1484241665)\n- [Springer](https://link.springer.com/book/10.1007/978-1-4842-4167-7)\n- [Apress](https://www.apress.com/gp/book/9781484241660)\n- [O'Reilly](https://www.oreilly.com/library/view/practical-computer-vision/9781484241677)\n- [Google Books](https://books.google.com.eg/books?id=xLd9DwAAQBAJ)\n\n![Fig04](https://user-images.githubusercontent.com/16560492/78830077-ae7c2800-79e7-11ea-980b-53b6bd879eeb.jpg)\n\n# Citing PyGAD - Bibtex Formatted Citation\n\nIf you used PyGAD, please consider adding a citation to the following paper about PyGAD:\n\n```\n@misc{gad2021pygad,\n      title={PyGAD: An Intuitive Genetic Algorithm Python Library}, \n      author={Ahmed Fawzy Gad},\n      year={2021},\n      eprint={2106.06158},\n      archivePrefix={arXiv},\n      primaryClass={cs.NE}\n}\n```\n\n# Contact Us\n\n* E-mail: ahmed.f.gad@gmail.com\n* [LinkedIn](https://www.linkedin.com/in/ahmedfgad)\n* [Amazon Author Page](https://amazon.com/author/ahmedgad)\n* [Heartbeat](https://heartbeat.fritz.ai/@ahmedfgad)\n* [Paperspace](https://blog.paperspace.com/author/ahmed)\n* [KDnuggets](https://kdnuggets.com/author/ahmed-gad)\n* [TowardsDataScience](https://towardsdatascience.com/@ahmedfgad)\n* [GitHub](https://github.com/ahmedfgad)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedfgad%2Ftorchga","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmedfgad%2Ftorchga","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedfgad%2Ftorchga/lists"}