Mercurial > pylearn
comparison pylearn/dataset_ops/tinyimages.py @ 1420:7374d676c9b0
dataset_ops/tinyimages - added a tinyimages_op that gives access to the full
dataset, not just patches.
author | James Bergstra <bergstrj@iro.umontreal.ca> |
---|---|
date | Fri, 04 Feb 2011 16:06:00 -0500 |
parents | cc3e3e596500 |
children | 93e5ce7ccd6d |
comparison
equal
deleted
inserted
replaced
1419:cff305ad9f60 | 1420:7374d676c9b0 |
---|---|
31 # PYLEARN_DATA_ROOT root). | 31 # PYLEARN_DATA_ROOT root). |
32 # | 32 # |
33 # Hopefully the upcoming pylearn library proposal will have a policy on how/where this sort of | 33 # Hopefully the upcoming pylearn library proposal will have a policy on how/where this sort of |
34 # pre-processed data should be stored. For now it is stored in the current working directory. | 34 # pre-processed data should be stored. For now it is stored in the current working directory. |
35 # | 35 # |
36 | |
37 def tinyimages_op(s_idx): | |
38 """Return symbolic tiny_images[s_idx] | |
39 | |
40 If s_idx is a scalar, the return value is a tensor3 of shape 32,32,3 and | |
41 dtype uint8. | |
42 If s_idx is a vector of len N, the return value | |
43 is a tensor4 of shape N,32,32,3 and dtype uint8. | |
44 """ | |
45 op = TensorFnDataset('uint8', | |
46 bcast=(False, False, False), | |
47 fn=tinyimages.get_memmapped_file, | |
48 single_shape=(32,32,3)) | |
49 return op(s_idx) | |
50 | |
36 | 51 |
37 _raw_patch_file = 'tinydataset_raw.npy' | 52 _raw_patch_file = 'tinydataset_raw.npy' |
38 _pca_file = 'tinydataset_pca.pkl' | 53 _pca_file = 'tinydataset_pca.pkl' |
39 _whitened_file = 'tinydataset_whitened.npy' | 54 _whitened_file = 'tinydataset_whitened.npy' |
40 | 55 |