{ "info": { "author": "", "author_email": "justheuristic@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Scientific/Engineering" ], "description": "#based on http://stackoverflow.com/questions/7323664/python-generator-pre-fetch\n\nThis is a single-function package that transforms arbitrary generator into a background-thead generator that prefetches several batches of data in a parallel background thead.\n\nThis is useful if you have a computationally heavy process (CPU or GPU) that iteratively processes minibatches from the generator while the generator consumes some other resource (disk IO / loading from database / more CPU if you have unused cores). \n\nBy default these two processes will constantly wait for one another to finish. If you make generator work in prefetch mode (see examples below), they will work in parallel, potentially saving you your GPU time.\n\nWe personally use the prefetch generator when iterating minibatches of data for deep learning with tensorflow and theano ( lasagne, blocks, raw, etc.).\n\nQuick usage example (ipython notebook) - https://github.com/justheuristic/prefetch_generator/blob/master/example.ipynb\n\nThis package contains two objects\n - BackgroundGenerator(any_other_generator[,max_prefetch = something])\n - @background([max_prefetch=somethind]) decorator\n\nthe usage is either\n\n#for batch in BackgroundGenerator(my_minibatch_iterator):\n# doit()\n\nor\n\n#@background()\n#def iterate_minibatches(some_param):\n# while True:\n# X = read_heavy_file()\n# X = do_helluva_math(X)\n# y = wget_from_pornhub()\n# do_pretty_much_anything()\n# yield X_batch, y_batch\n\n\nMore details are written in the BackgroundGenerator doc\nhelp(BackgroundGenerator)", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/justheuristic/prefetch_generator", "keywords": "background generator,prefetch generator,parallel generator,prefetch,background,deep learning,theano,tensorflow,lasagne,blocks", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "prefetch_generator", "package_url": "https://pypi.org/project/prefetch_generator/", "platform": "", "project_url": "https://pypi.org/project/prefetch_generator/", "project_urls": { "Homepage": "https://github.com/justheuristic/prefetch_generator" }, "release_url": "https://pypi.org/project/prefetch_generator/1.0.1/", "requires_dist": null, "requires_python": "", "summary": "a simple tool to compute arbitrary generator in a background thread", "version": "1.0.1" }, "last_serial": 4521997, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "bd7f7d036ab31382135c494596597093", "sha256": "0e29eea8a7543150a9a77b0cded630a3116a6de16e0d5cbbab28625a8184681a" }, "downloads": -1, "filename": "prefetch_generator-1.0.0.tar.gz", "has_sig": false, "md5_digest": "bd7f7d036ab31382135c494596597093", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3175, "upload_time": "2016-08-13T10:00:53", "url": "https://files.pythonhosted.org/packages/e6/e2/4e5ad1666e02ec6f167094870006dc4e4042314a42f32d49339bd03711fc/prefetch_generator-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "a6133b5a51745d1b76d4f1ef743b060d", "sha256": "835a69401c67d38ec79d7f5e965481807df6de1365d5fd5e27a8b6ed0ea16b79" }, "downloads": -1, "filename": "prefetch_generator-1.0.1.tar.gz", "has_sig": false, "md5_digest": "a6133b5a51745d1b76d4f1ef743b060d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3433, "upload_time": "2018-11-23T23:18:52", "url": "https://files.pythonhosted.org/packages/90/cb/3b6b53c197a7aa7b5315d415a7fd941236c15899faaf94d5bd0d8b91dbab/prefetch_generator-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a6133b5a51745d1b76d4f1ef743b060d", "sha256": "835a69401c67d38ec79d7f5e965481807df6de1365d5fd5e27a8b6ed0ea16b79" }, "downloads": -1, "filename": "prefetch_generator-1.0.1.tar.gz", "has_sig": false, "md5_digest": "a6133b5a51745d1b76d4f1ef743b060d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3433, "upload_time": "2018-11-23T23:18:52", "url": "https://files.pythonhosted.org/packages/90/cb/3b6b53c197a7aa7b5315d415a7fd941236c15899faaf94d5bd0d8b91dbab/prefetch_generator-1.0.1.tar.gz" } ] }