# HG changeset patch # User James Bergstra # Date 1296853560 18000 # Node ID 7374d676c9b0959c944d1dbd62e8d9ee0ea8b908 # Parent cff305ad9f6016ed9d8b1233480fbf96d31c4cad dataset_ops/tinyimages - added a tinyimages_op that gives access to the full dataset, not just patches. diff -r cff305ad9f60 -r 7374d676c9b0 pylearn/dataset_ops/tinyimages.py --- a/pylearn/dataset_ops/tinyimages.py Fri Feb 04 16:05:22 2011 -0500 +++ b/pylearn/dataset_ops/tinyimages.py Fri Feb 04 16:06:00 2011 -0500 @@ -34,6 +34,21 @@ # pre-processed data should be stored. For now it is stored in the current working directory. # +def tinyimages_op(s_idx): + """Return symbolic tiny_images[s_idx] + + If s_idx is a scalar, the return value is a tensor3 of shape 32,32,3 and + dtype uint8. + If s_idx is a vector of len N, the return value + is a tensor4 of shape N,32,32,3 and dtype uint8. + """ + op = TensorFnDataset('uint8', + bcast=(False, False, False), + fn=tinyimages.get_memmapped_file, + single_shape=(32,32,3)) + return op(s_idx) + + _raw_patch_file = 'tinydataset_raw.npy' _pca_file = 'tinydataset_pca.pkl' _whitened_file = 'tinydataset_whitened.npy'