mila-iqia / blocks-extras

A collection of extensions to the Blocks framework
MIT License
27 stars 40 forks source link

Added PredictDataStream extension and corresponding test #49

Closed aukejw closed 8 years ago

aukejw commented 8 years ago

Extension that evaluates tensors for a given datastream. Typical use case is when you want to generate predictions for a test set. If indicated, predictions are pickled and saved. I chose pickle over numpy.save because it allowed me to map the tensor names to arrays - sadly, using the tensor itself as key resulted in KeyErrors.

It's possible that MonitoredQuantity or DatasetEvaluator could be used instead, but @dwf warned me in this issue that concatenating after every step (using e.g. a Concatenate aggregation scheme) was probably going to be more memory-intensive than concatenating once at the end of the callback.

dwf commented 8 years ago

Looks good to me, thanks!