Mercurial > pylearn
changeset 230:4d1bd2513e06
more test speed
author | Frederic Bastien <bastienf@iro.umontreal.ca> |
---|---|
date | Fri, 23 May 2008 10:21:52 -0400 |
parents | d7250ee86f72 |
children | 38beb81f4e8b |
files | test_dataset.py |
diffstat | 1 files changed, 14 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/test_dataset.py Fri May 16 16:40:26 2008 -0400 +++ b/test_dataset.py Fri May 23 10:21:52 2008 -0400 @@ -496,32 +496,37 @@ a2 = numpy.random.rand(100000,400) ds = ArrayDataSet(a2,{'x':slice(3),'y':3,'z':[0,2]})###???tuple not tested ds = ArrayDataSet(a2,LookupList(['x','y','z'],[slice(3),3,[0,2]]))###???tuple not tested - ds = ArrayDataSet(a2,{all:slice(0,a2.shape[1],1)}) + ds = ArrayDataSet(a2,{'all':slice(0,a2.shape[1],1)}) #assert ds==a? should this work? + mat = numpy.random.rand(400,100) @print_timing def f_array1(a): a+1 @print_timing def f_array2(a): for id in range(a.shape[0]): - pass -# a[id]+1 +# pass + a[id]+1 +# a[id]*mat @print_timing def f_ds(ds): for ex in ds: - pass -# ex[0]+1 +# pass + ex[0]+1 +# a[id]*mat @print_timing def f_ds_mb1(ds,mb_size): for exs in ds.minibatches(minibatch_size = mb_size): for ex in exs: - pass -# ex[0]+1 +# pass + ex[0]+1 +# ex[id]*mat @print_timing def f_ds_mb2(ds,mb_size): for exs in ds.minibatches(minibatch_size = mb_size): - pass -# exs[0]+1 +# pass + exs[0]+1 +# ex[id]*mat f_array1(a2) f_array2(a2)