Skip to main content

GSK algorithm for efficient hyperparameter optimization

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

GSKhopt-0.0.6.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

GSKhopt-0.0.6-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

Details for the file GSKhopt-0.0.6.tar.gz.

File metadata

  • Download URL: GSKhopt-0.0.6.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for GSKhopt-0.0.6.tar.gz
Algorithm Hash digest
SHA256 40fa4b4f7271614c88c4f00d169dc710386a7966836d950677dd846f8024fca7
MD5 47105fe2c3342db2d1a11ce577e90b43
BLAKE2b-256 924f24ca77e4dbf7ca79a88d2554b991dadd433dccabf5e1d15a66d3f0a24628

See more details on using hashes here.

File details

Details for the file GSKhopt-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: GSKhopt-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 28.3 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for GSKhopt-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 2381652c59d0c234e331d19f48423211c10b5d64d8b494d95e34a636bbbb9754
MD5 bf0111b34d72e4a39bf9e80bd6cb612e
BLAKE2b-256 5cf18c000e63595208b8ce52a67d27b8a0ff7c1fc4820dd5323eef51538b80cf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page