{ "info": { "author": "Peter Ward", "author_email": "peteraward@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "*Hufflepuffs are particularly good finders.*\n\nHufflepuff is a program for exploring large mostly-convex search spaces.\nThe algorithm it uses is basically\n[beam search](https://en.wikipedia.org/wiki/Beam_search), except that it\u2019s\nexpected that exploring all successors of any node is too computationally\nexpensive, and so it explores a sample of them (with larger sample sizes for\nhigher-scoring nodes).\n\nYou need to provide three things to Hufflepuff:\n\n1. The initial state(s) to explore from.\n1. A program for generating a successor of a given state.\n (the same state may be given multiple times to get multiple successors)\n1. A program for assigning a score to any state.\n\nHufflepuff has been used to:\n\n* Group students into roughly equal teams, given approximate skill levels.\n* Assign students to classes, such that class sizes are roughly equal and\n students\u2019 preferences are taken into account.\n* Generate source code for an esoteric programming language that produced a\n desired output.\n\nIn those three cases, the initial states were randomly generated (with virtually\nno domain knowledge), the successor generation just randomly changed elements in\nthe state, leaving the scoring program as the single place for specifying the\ndesired properties of the solution.\n\n# Invocation\n\nWith a config file:\n\n $ hufflepuff -c config.cfg\n\nconfig.cfg:\n\n initial-file = initial.json\n initial-binary = cat $initial-file\n mutate-binary = ./mutate\n score-binary = ./score\n\n beam-width = 5\n expand-mantissa = 1.25\n expand-multiplier = 3\n target = max\n\n num-iterations = 20\n parallelism = NUM_CPUS\n\nThe config file is a shorthand for providing the args on the command line:\n\n $ hufflepuff --initial-binary=./initial\n\n# Search parameters\n\nBy default, hufflepuff will attempt to find states with the highest scores: this\nis specified by ``--target=max``. If your score metric is a \u201ccost\u201d, then setting\n``--target=min`` will make it attempt to find states with the lowest scores.\n\nThe algorithm followed for searching is:\n\n1. Get the states from ``--initial-binary``.\n1. For ``--num-iterations`` iterations:\n 1. Generate a new set of states from the current set of states.\n * The best-scored state will have ``--expand-multiplier`` states generated\n from it.\n * Following states will have an exponentially decreasing number of states\n generated from them (rounding down, but there will always be at least one\n new state for each current state).\n 1. Score the new states.\n 1. Throw away all but the best ``--beam-width`` states.\n\nHowever, in addition, the best ``--beam-width`` states ever seen are kept, for\noutput at the end of the search.\n\n# Communication\n\nAll binaries are expected to use newline-separated JSON values, either read from\nstdin, or written to stdout, encoded in UTF-8.\n\nIn order to fully utilise multiple cores, multiple instances of the mutation and\nscoring binaries are run, and input is provided simultaneously (so these\nbinaries can be written as na\u00efve single-threaded processes but still scale\nseamlessly).\n\nIf this is not desired (for instance, if there is a shared resource, or if you\nwant to implement an more sophisticated form of parallelism),\nset ``--parallelism=1``.\nFuture lines of input may be provided before a given line has finished\nprocessing to aid in this, but this should not be relied upon (don\u2019t block a\nline of output on reading the next line of input).\n\n## Initial binary\n\nThe ``initial-binary`` is run to provide the set of starting values for the\nsearch. For convenience, the substring \"$initial-file\" is replaced with the\nvalue of the ``initial-file`` argument, so the default behaviour is to read from\nthat file.\n\nA particularly useful thing to do with this is to store the results of a search\nin ``best.txt``, and then use ``--initial-file=best.json`` to continue the\nsearch from that point.\n\n## Mutation binary\n\nThe ``mutate-binary`` is run to take values and turn them into slightly\ndifferent values (e.g., swap two values in a list, or add/subtract some amount\nfrom a number). Usually this should be done entirely at random, rather than\ntrying to make a \u201csmart\u201d decision: the search will quickly eliminate **really**\nbad options, and you may need intermediate okay-ish states.\n\nEach line of input should correspond to exactly one line of output (if\nhufflepuff wants multiple mutations, it will enter the value multiple times).\n\n## Scoring binary\n\nThe ``score-binary`` is run to provide a number (floating point or integral)\nvalue for a value. The default meaning is that larger numbers are better, but\nthis is controlled by ``--target={max,min}``.\n\nEach line of input should correspond to exactly one line of output, and this\nprogram should be deterministic (a given value produces the same score every\ntime).\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://hg.flowblok.id.au/hufflepuff", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "hufflepuff", "package_url": "https://pypi.org/project/hufflepuff/", "platform": "", "project_url": "https://pypi.org/project/hufflepuff/", "project_urls": { "Homepage": "https://hg.flowblok.id.au/hufflepuff" }, "release_url": "https://pypi.org/project/hufflepuff/1.4/", "requires_dist": [ "six" ], "requires_python": "", "summary": "Hufflepuffs are particularly good finders.", "version": "1.4" }, "last_serial": 5262154, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "0688745a63941afe5661c78057cff035", "sha256": "44a87c39d5aa457bebe7f6ec4026c2b354b03745dd2de11545d044046a984412" }, "downloads": -1, "filename": "hufflepuff-1.0.tar.gz", "has_sig": false, "md5_digest": "0688745a63941afe5661c78057cff035", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3877, "upload_time": "2015-10-07T11:13:12", "url": "https://files.pythonhosted.org/packages/b8/7a/deffc68d8b5228f04e8aaa25c02528247643da424e415053ed7632a183f4/hufflepuff-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "75b76163f364e0ab593d36c429ce5b9e", "sha256": "b32e443e8583fdc02d3f33a2c3c8334eee5b7c2ec59840696e54e5cabb7f0c6e" }, "downloads": -1, "filename": "hufflepuff-1.1.tar.gz", "has_sig": false, "md5_digest": "75b76163f364e0ab593d36c429ce5b9e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3927, "upload_time": "2016-01-05T22:51:09", "url": "https://files.pythonhosted.org/packages/47/49/339fd5b2bd0b8e602b319a211d1b6a368c5066759e63ee8ae1a84ce9a591/hufflepuff-1.1.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "0ab20c98e8ec95e2ae12c332c3b67b54", "sha256": "76073a97a477a0ebe70306dcd96ad6ad1b1a562b5ae3a079425754190eb73b82" }, "downloads": -1, "filename": "hufflepuff-1.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0ab20c98e8ec95e2ae12c332c3b67b54", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6046, "upload_time": "2017-09-15T23:30:05", "url": "https://files.pythonhosted.org/packages/84/9f/a54af1f95132262cd473d342a5e7e9976909530eaba218040c3f2e7f269a/hufflepuff-1.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5259547d6d832ca81fce06611ba0c1a1", "sha256": "177d8599f067d0d70c47d5c051f84203357baa68200a6878be11841a3db57c3b" }, "downloads": -1, "filename": "hufflepuff-1.2.1.tar.gz", "has_sig": false, "md5_digest": "5259547d6d832ca81fce06611ba0c1a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4023, "upload_time": "2017-09-15T23:30:06", "url": "https://files.pythonhosted.org/packages/b5/d0/d12295a68e4ef2cf1f53895b0f619b57896d425bc98fa4263a45578a74ff/hufflepuff-1.2.1.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "36a2404e0c3c6c89386e1c0f6b9e8c4e", "sha256": "3149d5533263a99e489e1578f15b3d4d082e5258a81a10bdfb96fedf790daf70" }, "downloads": -1, "filename": "hufflepuff-1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "36a2404e0c3c6c89386e1c0f6b9e8c4e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6080, "upload_time": "2018-01-08T02:39:09", "url": "https://files.pythonhosted.org/packages/8c/80/c2362745cd50c0a2fb53fe41bc121c17acef156a20b0571fb79bcb460941/hufflepuff-1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2cb0eec78e62176b30a829b1dceb1558", "sha256": "0e62668fd3d526b81456a8aeac9c921a3c58cdcab901778687e1354b9d72e55c" }, "downloads": -1, "filename": "hufflepuff-1.3.tar.gz", "has_sig": false, "md5_digest": "2cb0eec78e62176b30a829b1dceb1558", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6083, "upload_time": "2018-01-08T02:39:11", "url": "https://files.pythonhosted.org/packages/60/25/e669a93849433dfbe856db04304c5c574d563af55cb354c92165944da8e1/hufflepuff-1.3.tar.gz" } ], "1.3.2": [ { "comment_text": "", "digests": { "md5": "654c030cc93cd11e4bec27c329300fd8", "sha256": "17fde2de0b7c4fb1902e0d1191e9931a39beee220267ff3bbfffc6709d4f9dbc" }, "downloads": -1, "filename": "hufflepuff-1.3.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "654c030cc93cd11e4bec27c329300fd8", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7510, "upload_time": "2018-05-10T11:05:09", "url": "https://files.pythonhosted.org/packages/71/06/06969168e4d6be64ecd0813e17ff8f9401ec0fcda6413d790fe9f8ef0111/hufflepuff-1.3.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bb3764858a92e1729c612d567a4b8e86", "sha256": "6d704250e122798bc2c8ab3421cb1b3c543cb21a85a1c703b6fc418004f2e546" }, "downloads": -1, "filename": "hufflepuff-1.3.2.tar.gz", "has_sig": false, "md5_digest": "bb3764858a92e1729c612d567a4b8e86", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6794, "upload_time": "2018-05-10T11:05:10", "url": "https://files.pythonhosted.org/packages/97/95/4198428b93aef50456c0ee92dbb1294536af4ab8459a74d983de2481ace5/hufflepuff-1.3.2.tar.gz" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "ac0e5cde56c8393505e49edad0c6c8ee", "sha256": "16b038144ba3dc881329e0a1a8006772c1813fc135c07de15daff39d347d3f70" }, "downloads": -1, "filename": "hufflepuff-1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "ac0e5cde56c8393505e49edad0c6c8ee", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13408, "upload_time": "2019-05-13T12:59:55", "url": "https://files.pythonhosted.org/packages/6d/34/6b321a9d3ca7a6fbd66b6556c6c1525955d888dfa5e342b8e52aac3b276f/hufflepuff-1.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "170c0b4f87274ffa280aff03ee63a9d8", "sha256": "d206181c2f1eb75d74e689f4f8b47d51ede799a1a22dc3da7bab97126c8d5f4c" }, "downloads": -1, "filename": "hufflepuff-1.4.tar.gz", "has_sig": false, "md5_digest": "170c0b4f87274ffa280aff03ee63a9d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7938, "upload_time": "2019-05-13T12:59:57", "url": "https://files.pythonhosted.org/packages/a1/76/85a1bfce25ae2f845f3a46a77d1e58422aa54ee70e4a6c02b53a3d829cce/hufflepuff-1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ac0e5cde56c8393505e49edad0c6c8ee", "sha256": "16b038144ba3dc881329e0a1a8006772c1813fc135c07de15daff39d347d3f70" }, "downloads": -1, "filename": "hufflepuff-1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "ac0e5cde56c8393505e49edad0c6c8ee", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13408, "upload_time": "2019-05-13T12:59:55", "url": "https://files.pythonhosted.org/packages/6d/34/6b321a9d3ca7a6fbd66b6556c6c1525955d888dfa5e342b8e52aac3b276f/hufflepuff-1.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "170c0b4f87274ffa280aff03ee63a9d8", "sha256": "d206181c2f1eb75d74e689f4f8b47d51ede799a1a22dc3da7bab97126c8d5f4c" }, "downloads": -1, "filename": "hufflepuff-1.4.tar.gz", "has_sig": false, "md5_digest": "170c0b4f87274ffa280aff03ee63a9d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7938, "upload_time": "2019-05-13T12:59:57", "url": "https://files.pythonhosted.org/packages/a1/76/85a1bfce25ae2f845f3a46a77d1e58422aa54ee70e4a6c02b53a3d829cce/hufflepuff-1.4.tar.gz" } ] }