GeneticPy is an optimizer that uses a genetic algorithm to quickly search through custom parameter spaces for optimal solutions.
Project description
GeneticPy
GeneticPy is an optimizer that uses a genetic algorithm to quickly search through custom parameter spaces for optimal solutions.
Installation
GeneticPy requires Python 3.4+
pip install geneticpy
Example Usage:
A brief example to get you started is included below:
def loss_function(params):
if params['type'] == 'add':
return params['x'] + params['y']
elif params['type'] == 'multiply':
return params['x'] * params['y']
param_space = {'type': geneticpy.ChoiceDistribution(choice_list=['add', 'multiply']),
'x': geneticpy.UniformDistribution(low=5, high=10, q=1),
'y': geneticpy.GaussianDistribution(mean=0, standard_deviation=1)}
best_params, loss, total_time = geneticpy.optimize(loss_function, param_space, size=200, generation_count=500, verbose=True)
PyPi Project
https://pypi.org/project/geneticpy/
Contact
Please feel free to email me at brandonschabell@gmail.com with any questions or feedback.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
geneticpy-1.0.0.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for geneticpy-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ae24ce4983c4bd8c9124609f986781ee30802ee195327ea6c4a955461394414 |
|
MD5 | 019d789133efdfdd7a54f164306f49bf |
|
BLAKE2b-256 | f50fee0d34b0069954f554befecb0c8bd94e422c708d173aa2dd05a0284e8b96 |