Skip to content

This is a genetic algorithm example in which we use OpenAI gym environment and use its cartpole function. The fitness values for each generation improves though genetic algorithm. Problem statement and output graphs provided.

Notifications You must be signed in to change notification settings

devxdebanjan/geneticalgo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎯AIM

Goal of this program was to train a neural network model through genetic algorithm in gym environment API provided by OpenAI. Main goal of this task force to design an efficient crossover method and mutation method. Then we had to show the fitness graph over generations.

👨‍💻LANGUAGE

Python

💻OS

Supported in both Windows and Linux
Not tried yet on Mac

📚LIBRARIES USED

  • gym
  • NumPy
  • matplotlib
  • random

⚙️INSTRUCTIONS

Only instruction to run this file is if the graph is not optimal, stuck in local maxima, that is does not achieve a good maximum (say 180) then you can run this code again and that should solve the problem. This is due to the entire random structure of the algorithm overall.

About

This is a genetic algorithm example in which we use OpenAI gym environment and use its cartpole function. The fitness values for each generation improves though genetic algorithm. Problem statement and output graphs provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages