Metadata-Version: 1.1
Name: prefetch-generator
Version: 1.0.0
Summary: a simple tool to compute arbitrary generator in a background thread
Home-page: https://github.com/justheuristic/prefetch_generator
Author: UNKNOWN
Author-email: justheuristic@gmail.com
License: MIT
Description: 
        #based on http://stackoverflow.com/questions/7323664/python-generator-pre-fetch
        
        This 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.
        
        This 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). 
        
        By 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.
        
        We personally use the prefetch generator when iterating minibatches of data for deep learning with tensorflow and theano ( lasagne, blocks, raw, etc.).
        
        This package contains two objects
         - BackgroundGenerator(any_other_generator[,max_prefetch = something])
         - @background([max_prefetch=somethind]) decorator
        
        the usage is either
        
        #for batch in BackgroundGenerator(my_minibatch_iterator):
        #    doit()
        
        or
        
        #@background()
        #def iterate_minibatches(some_param):
        #    while True:
        #        X = read_heavy_file()
        #        X = do_helluva_math(X)
        #        y = wget_from_pornhub()
        #        do_pretty_much_anything()
        #        yield X_batch, y_batch
        
        
        More details are written in the BackgroundGenerator doc
        help(BackgroundGenerator)
        
        
Keywords: background generator,prefetch generator,parallel generator,prefetch,background,deep learning,theano,tensorflow,lasagne,blocks
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Topic :: Scientific/Engineering
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 2.7 
Classifier: Programming Language :: Python :: 3.4 
Classifier: Programming Language :: Python :: 3.5 
