Skip to main content

This an implementation of Gaining-sharing knowledge algorithm (GSK) in python. GSK is a nature inspired algorithm for solving real parameter optimization problems. GSK has two main stages the junior and senior phases each has a different mutation, the dimensions (or parameters) are changed by the mutations of both the junior and senior phases at the same time. GSK is a reliable and stable optimization algorithm. The repository also includes a visualization module for visualizing GSK runs. The code have been tested on CEC 2017 benchmark functions. Two version of GSK the BasicGSK and BasicGSKLSPR (with linear propulation reduction).

Usage

just type

$ python run.py

❤️  How to use GSK as a solver

solver = BasicGSKLPSR(k=10,kf=0.5,kr=0.9,p=0.1)
best , best_fit = solver.run(obj_func, dim, 100, [-100]*dim, [100]*dim)

you can also use the get_statstics functions and Viz after the run

vis = Viz(cec17_test_func,-100,100,dim,1)
best_hist,pop_hist = solver.getstatistics()
best_hist = np.array(best_hist)
best_hist = np.vstack((best_hist))
best_hist = best_hist.reshape((best_hist.shape[0],dim))
vis.set(dim,func+1,best_hist,pop_hist)
vis.build_plot()

There is also an example on using GSK for linear regression using scikit-learn

📫  We would love to hear from you

If you have any comments or questions just email h.nomer@nu.edu.eg We intend to realse a pip package soon with more examples. More work is done to GSK as a solver for different optimization problems.

✅  Requirements

**python 2.7 or higher **matplotlib (for visualization) **CSVDataFrame (or any other package for saving results)

Metadata

Release files for GSKhopt 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for GSKhopt 0.0.6
File Size Uploaded
GSKhopt-0.0.6.tar.gz 18.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for GSKhopt 0.0.6
File Interpreter ABI Platform
GSKhopt-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 46.6 kB

Release files / GSKhopt-0.0.6.tar.gz

Download URL GSKhopt-0.0.6.tar.gz
Size 18.2 kB
Tags Source
SHA-256 checksum
How to use checksums
40fa4b4f7271614c88c4f00d169dc710386a7966836d950677dd846f8024fca7
BLAKE2b-256 checksum
How to use checksums
924f24ca77e4dbf7ca79a88d2554b991dadd433dccabf5e1d15a66d3f0a24628
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/3.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

Release files / GSKhopt-0.0.6-py3-none-any.whl

Download URL GSKhopt-0.0.6-py3-none-any.whl
Size 28.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2381652c59d0c234e331d19f48423211c10b5d64d8b494d95e34a636bbbb9754
BLAKE2b-256 checksum
How to use checksums
5cf18c000e63595208b8ce52a67d27b8a0ff7c1fc4820dd5323eef51538b80cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/3.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page