I am using the following code, with nested generators, to iterate over a text document and return training examples using get_train_minibatch()
. I would like to
__iter__
method__getstate__
and __setstate__
methods to the class, to handling pickling. Remember that you can’t pickle file objects. So __setstate__
will have to re-open files, as necessary.I describe this method in more depth, with sample code, here.