Skip to content

Instantly share code, notes, and snippets.

View chttrjeankr's full-sized avatar
🐍
Think Pythonic

Ankur Chattopadhyay chttrjeankr

🐍
Think Pythonic
View GitHub Profile
@chttrjeankr
chttrjeankr / GA_max.py
Created April 3, 2021 16:49
Genetic Algorithm Maximization of Non-Linear Function
# genetic algorithm search for continuous function optimization
from numpy.random import randint
from numpy.random import rand
# objective function
# fitness function
def objective(x):
"""
# the function to optimize
>> x**2 - y * y**0.5 + 14