Mercurial > ift6266
view datasets/dataset.py @ 164:e3de934a98b6
Add nist_lower, nist_upper, nist_all
author | Arnaud Bergeron <abergeron@gmail.com> |
---|---|
date | Thu, 25 Feb 2010 18:53:02 -0500 |
parents | 4b28d7382dbf |
children | d6672a7daea5 |
line wrap: on
line source
from dsetiter import DataIterator class DataSet(object): def test(self, batchsize, bufsize=None): r""" Returns an iterator over the test examples. Parameters batchsize (int) -- the size of the minibatches, 0 means return the whole set at once. bufsize (int, optional) -- the size of the in-memory buffer, 0 to disable. """ return self._return_it(batchsize, bufsize, self._test) def train(self, batchsize, bufsize=None): r""" Returns an iterator over the training examples. Parameters batchsize (int) -- the size of the minibatches, 0 means return the whole set at once. bufsize (int, optional) -- the size of the in-memory buffer, 0 to disable. """ return self._return_it(batchsize, bufsize, self._train) def valid(self, batchsize, bufsize=None): r""" Returns an iterator over the validation examples. Parameters batchsize (int) -- the size of the minibatches, 0 means return the whole set at once. bufsize (int, optional) -- the size of the in-memory buffer, 0 to disable. """ return self._return_it(batchsize, bufsize, self._valid) def _return_it(batchsize, bufsize, data): r""" Must return an iterator over the specified dataset (`data`). Implement this in subclassses. """ raise NotImplemented