The purpose of the study was to design a flight control system with no pre-determined mathematical model, but instead using a genetic algorithm to maintain the optimal altitude. The study is done through a quantitative empirical research method. In the process of conducting the research, we found that programming a genetic algorithm was cumbersome for novice users to implement. Due to this, we created and released an open-source Python package called EasyGA.
An initial population of 15 chromosomes, 10 genes per chromosome with 100 generations, were used during one trial. The throttle value of the device had an associated gene…
To keep my promise, here is all the code you will need to get your first genetic algorithm working with the EasyGA package.
pip3 install EasyGA
Run the code below in a python file anywhere on your computer.
# Create the Genetic algorithm
ga = EasyGA.GA()
# Evolve the genetic algorithm until termination has been reached
# Print out the current generation and the population
Current Generation : 15
Chromosome - 0  / Fitness = 3
Chromosome - 1  / Fitness = 3
Chromosome - 2  / Fitness…
For our example we will be making the EasyNumberMNIST package. Below is the file and folder structure:
│ ├── EasyNumberMNIST.py
│ └── __init__.py
To make the tree output clear, you will need a folder with 2 files and 1 folder in the main directory of your overall folder. The following files need to be created inside the main folder: README.md, setup.py, and a folder with the name of your package. Inside the package folder you will need the name of your main python file and an __init__.py file.
There is a lot of…
As of right now there is not that many good tutorials teaching those new to python / raspberry pi how to control a stepper motor. In this tutorial your going to learn how to control a stepper motor using a Raspberry PI, TB6600 stepper motor controller and Python.
I love to show examples first for people like me who don't want to read too much. Here is the wiring diagram and code used in this tutorial.
All the code can be found here or at the bottom of the article.
This tutorial can be broken down into two sections. First…
A fun and easy way to learn about genetic algorithms by cracking a password.
So lets get straight to it.
pip3 install EasyGA
Now you have access to the EasyGA package. If you’ve never used it before I would check out the wiki or the getting started with EasyGA article that was created. They use the popular game among us to explain some of the novice features. Now were going to try and crack the password: EasyGA. Yup the worst password ever but it proves the point here.
import random#Create the Genetic Algorithm
ga = EasyGA.GA()password…
Dedicated college student who loves to write simple code for everyone. Passion to make machine learning for everyone.