{ "info": { "author": "Ally Hume", "author_email": "a.hume@epcc.ed.ac.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only", "Topic :: Scientific/Engineering" ], "description": "***********************************************************\nNiching Migratory Multi-Swarm Optimser for Python (pynmmso)\n***********************************************************\n\nPython implementation of the Niching Migratory Multi-Swarm Optimser, described\nin: \"*Running Up Those Hills: Multi-Modal Search with the Niching Migratory Multi-Swarm Optimiser*\"\nby Jonathan E. Fieldsend published in Proceedings of the IEEE Congress on Evolutionary Computation, \npages 2593-2600, 2014 (http://hdl.handle.net/10871/15247)\n\nPlease reference this paper if you undertake work utilising this code.\n\nDocumentation for pynmmso can be found at: https://github.com/EPCCed/pynmmso/wiki\n\nInstall pynmmso\n===============\n\nThe Python implementation of NMMSO requires Python 3 and Numpy (https://www.numpy.org/). \n\nYou can install pynmmso using pip::\n\n pip install pynmmso\n\nUsing NMMSO\n===========\n\nWe will demonstrate using NMMSO to solve a one-dimensional optimisation problem. The function will we optimise is:\n\n-x\\ :sup:`4` + x\\ :sup:`3` + 3x\\ :sup:`2`\n\nPlotting this function with x in the range [-2, 3] gives:\n\n.. image:: https://github.com/EPCCed/pynmmso/wiki/images/1D-function.png\n\nThis function has two optima (one global and one local). We can use NMMSO to find these optima.\n\nFirst we need to write Python code that captures the problem we wish to solve. Problems must be written as a Python class that implements two functions: ``fitness`` and ``get_bounds``.\n\nThe ``fitness`` function takes one argument. This argument is a 1D Numpy array containing a value for each parameter of the problem. Since our problem is one dimensional this array will contain a single value. The function must return a single scalar value which is the *fitness* for the given parameter values. This is where we implement the function to be optimised.\n\nThe ``get_bounds`` function takes no arguments and returns two Python lists that define the bounds of the parameter search. The first list specifies the minimum value for each parameter, the second list specifies the maximum value for each parameter. As our problem is one dimensional there will only be one value in each list.\n\nThe implementation of our problem in Python is therefore:\n\n.. code-block:: python\n\n class MyProblem:\n @staticmethod\n def fitness(params):\n x = params[0]\n return -x**4 + x**3 + 3 * x**2\n\n @staticmethod\n def get_bounds():\n return [-2], [3]\n\nThe following code uses NMMSO to solve this problem. The ``Nmmso`` object is constructed with an instance of the problem class. The algorithm is then run and will stop at the end of the iteration where the number of fitness function evaluations exceeds the given\namount. When run the algorithm returns a list of objects that contain the location and value for each of the discovered modes.\n\n.. code-block:: python\n\n from pynmmso import Nmmso\n\n\n class MyProblem:\n @staticmethod\n def fitness(params):\n x = params[0]\n return -x**4 + x**3 + 3 * x**2\n\n @staticmethod\n def get_bounds():\n return [-2], [3]\n\n\n def main():\n number_of_fitness_evaluations = 1000\n\n nmmso = Nmmso(MyProblem())\n my_result = nmmso.run(number_of_fitness_evaluations)\n for mode_result in my_result:\n print(\"Mode at {} has value {}\".format(mode_result.location, mode_result.value))\n\n\n if __name__ == \"__main__\":\n main()\n\n\nRunning this code produces output similar to the following:\n\n.. code-block:: python\n\n Mode at [1.65586203] has value 5.247909824656198\n Mode at [-0.90586887] has value 1.0450589249496887\n\nIt has correctly found the two peaks in the graph.\n\nFurther documentation is describing more advanced usage is available at: https://github.com/EPCCed/pynmmso/wiki", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/EPCCed/pynmmso/wiki", "keywords": "optimization,optimisation,optimizer,optimiser,multimodal,multi-modal,GA,genetic", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pynmmso", "package_url": "https://pypi.org/project/pynmmso/", "platform": "", "project_url": "https://pypi.org/project/pynmmso/", "project_urls": { "Homepage": "https://github.com/EPCCed/pynmmso/wiki" }, "release_url": "https://pypi.org/project/pynmmso/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "Multi-Modal Search with the Niching Migratory Multi-Swarm Optimizer", "version": "1.0.0" }, "last_serial": 5511944, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "9418b4d546e5238d2f8d1a8e38e93de9", "sha256": "41bee2b99bfebfc7ca6a19c5147864854a9affbb713746e0fd5a3606521ec1ce" }, "downloads": -1, "filename": "pynmmso-0.1.tar.gz", "has_sig": false, "md5_digest": "9418b4d546e5238d2f8d1a8e38e93de9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14558, "upload_time": "2019-05-22T09:38:04", "url": "https://files.pythonhosted.org/packages/7b/f4/dc1932c52b7579c385e1be1018da923b4d42a5712edda162c63dd88f45a2/pynmmso-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "b7b19dcedcc90c7912d3b92d9a4c5f33", "sha256": "bf8b679c9b2f5325a1a602b63001fa2ed2ca3de85635671ed18b713d29adb51c" }, "downloads": -1, "filename": "pynmmso-0.2.tar.gz", "has_sig": false, "md5_digest": "b7b19dcedcc90c7912d3b92d9a4c5f33", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16992, "upload_time": "2019-05-22T14:47:51", "url": "https://files.pythonhosted.org/packages/1a/e6/29305498ec7f1acc412f77ace8d14b20e845fdb979898217c802de2ccd25/pynmmso-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "89054541d2c816367b667e14ddabed09", "sha256": "037705f70a8da72d0bd782ed4936d7280a54a60d159030b7cc3ad7662d3a2f6f" }, "downloads": -1, "filename": "pynmmso-0.3.tar.gz", "has_sig": false, "md5_digest": "89054541d2c816367b667e14ddabed09", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17005, "upload_time": "2019-06-11T13:48:57", "url": "https://files.pythonhosted.org/packages/9f/39/95e6ba49834ce2a780a90e7f96129112b16a880446a95a3fcfe6decbbc7d/pynmmso-0.3.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "f7afb199254da05253782eda4385e86b", "sha256": "dda30f96aef6b16d9f806109295a79f0628bfaa6e3b8cffefa02817fd65cf478" }, "downloads": -1, "filename": "pynmmso-1.0.0.tar.gz", "has_sig": false, "md5_digest": "f7afb199254da05253782eda4385e86b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17884, "upload_time": "2019-07-10T12:51:06", "url": "https://files.pythonhosted.org/packages/4c/39/9343eaf85cf4814281c3daffd323906b5d35244b74d82705bc5a04cb48ca/pynmmso-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f7afb199254da05253782eda4385e86b", "sha256": "dda30f96aef6b16d9f806109295a79f0628bfaa6e3b8cffefa02817fd65cf478" }, "downloads": -1, "filename": "pynmmso-1.0.0.tar.gz", "has_sig": false, "md5_digest": "f7afb199254da05253782eda4385e86b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17884, "upload_time": "2019-07-10T12:51:06", "url": "https://files.pythonhosted.org/packages/4c/39/9343eaf85cf4814281c3daffd323906b5d35244b74d82705bc5a04cb48ca/pynmmso-1.0.0.tar.gz" } ] }