{ "info": { "author": "Zixuan Chen", "author_email": "remch183@outlook.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Priority Memory\n\nA prioritized sampling tool for priority memory replay.\n\nThe implementation is based on sum tree, or segmentation tree.\n\n- Set the priority of each sample at anytime. \n- When you do not know the priority of the sample, you can append \n them to the buffer, and they will show up in the next sampling batch.\n- When the buffer is full, drop the samples with lowest priority.\n\nThe time complexity for sampling a batch with batch size m \nfrom a dataset with n samples is O(mlogn), for setting priority \nfor the batch is O(mlogn).\n\n\n# Usage\n\n> pip install priority_memory\n\n```python\n\nfrom priority_memory import FastPriorReplayBuffer\n\nbuffer = FastPriorReplayBuffer(8000)\nbuffer.append(features=[0.1, 0.1, 0.1], prior=1)\nbuffer.append(features=[0.2, 0.2, 0.2], prior=2)\nbuffer.append(features=[0.3, 0.3, 0.3], prior=3)\nbuffer.append(features=[0.4, 0.4, 0.4], prior=4)\nindexes, data, weights = buffer.sample_with_weights(batch_size=2)\n\nmae = [10, 20]\nbuffer.set_weights(indexes, mae)\n\n```", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/rem2016/priority_memory_buffer", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "priority-memory", "package_url": "https://pypi.org/project/priority-memory/", "platform": "", "project_url": "https://pypi.org/project/priority-memory/", "project_urls": { "Homepage": "https://github.com/rem2016/priority_memory_buffer" }, "release_url": "https://pypi.org/project/priority-memory/0.0.2/", "requires_dist": null, "requires_python": "", "summary": "A prioritized sampling tool.", "version": "0.0.2" }, "last_serial": 4520410, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "6a82c83fca776a42ba6c6526708056cb", "sha256": "b566717a30d50ec1e788cddbdab08adbdc85ef2e139da7155bf4f8a3dea6d1c4" }, "downloads": -1, "filename": "priority_memory-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "6a82c83fca776a42ba6c6526708056cb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14313, "upload_time": "2018-11-23T12:01:06", "url": "https://files.pythonhosted.org/packages/a9/86/d77de5088883f5d1968839629042c2dfc5b8ddcfebb97685306c0b01b872/priority_memory-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "10bd5765e62a652cd4adf9cd3dc17b59", "sha256": "a12a81d771be203e2eb218bcd572081b59ac76b9c0b7fec032a9352f0f2c3cf3" }, "downloads": -1, "filename": "priority_memory-0.0.1.tar.gz", "has_sig": false, "md5_digest": "10bd5765e62a652cd4adf9cd3dc17b59", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7351, "upload_time": "2018-11-23T12:01:08", "url": "https://files.pythonhosted.org/packages/99/ca/cc32b6e11338fbbf1be1f5968b3d848d0c69671fdba6fdb487154ce80be8/priority_memory-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "638d02e54949b6ec71f2762b008a7247", "sha256": "902b9cf6050a723a8659709151ee1ac7ed38a90553f2ddd3bbfdd6310d6c98f8" }, "downloads": -1, "filename": "priority_memory-0.0.2.tar.gz", "has_sig": false, "md5_digest": "638d02e54949b6ec71f2762b008a7247", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7384, "upload_time": "2018-11-23T12:09:06", "url": "https://files.pythonhosted.org/packages/c8/8e/e5ba48ab51e7f4255016aa9c8f1e1843d38e3826f682462ede90b49b62fd/priority_memory-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "638d02e54949b6ec71f2762b008a7247", "sha256": "902b9cf6050a723a8659709151ee1ac7ed38a90553f2ddd3bbfdd6310d6c98f8" }, "downloads": -1, "filename": "priority_memory-0.0.2.tar.gz", "has_sig": false, "md5_digest": "638d02e54949b6ec71f2762b008a7247", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7384, "upload_time": "2018-11-23T12:09:06", "url": "https://files.pythonhosted.org/packages/c8/8e/e5ba48ab51e7f4255016aa9c8f1e1843d38e3826f682462ede90b49b62fd/priority_memory-0.0.2.tar.gz" } ] }