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)}
results = geneticpy.optimize(loss_function, param_space, size=200, generation_count=500, verbose=True)
best_params = results['top_params']
loss = results['top_score']
total_time = results['total_time']
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.1.0.tar.gz
(4.9 kB
view hashes)
Built Distribution
Close
Hashes for geneticpy-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8081f91aa14d644cbcc8132d4ff05ef50d2b7be1ae7a18617c563a03a7914141 |
|
MD5 | 1374b516cebbdd2a1bd6f43cbe484b0c |
|
BLAKE2b-256 | ad576a1fcbf875d0858cd3315b1a4e55df983996eb6da42ee9cd84b0636169b1 |