Mercurial > pylearn
diff _test_dataset.py @ 293:4bfdda107a17
still merging
author | James Bergstra <bergstrj@iro.umontreal.ca> |
---|---|
date | Fri, 06 Jun 2008 16:13:17 -0400 |
parents | 174374d59405 |
children | f7924e13e426 |
line wrap: on
line diff
--- a/_test_dataset.py Fri Jun 06 15:56:18 2008 -0400 +++ b/_test_dataset.py Fri Jun 06 16:13:17 2008 -0400 @@ -47,6 +47,11 @@ #not in doc!!! i=0 for example in range(len(ds)): + wanted = array[example][:3] + returned = ds[example]['x'] + if (wanted != returned).all(): + print 'returned:', returned + print 'wanted:', wanted assert (ds[example]['x']==array[example][:3]).all() assert ds[example]['y']==array[example][3] assert (ds[example]['z']==array[example][[0,2]]).all() @@ -226,8 +231,7 @@ assert i==m.n_batches*m.minibatch_size del x,y,i,id - #@todo: we can't do minibatch bigger then the size of the dataset??? - assert have_raised2(ds.minibatches,['x','y'],n_batches=1,minibatch_size=len(array)+1,offset=0) + assert not have_raised2(ds.minibatches,['x','y'],n_batches=1,minibatch_size=len(array)+1,offset=0) assert not have_raised2(ds.minibatches,['x','y'],n_batches=1,minibatch_size=len(array),offset=0) def test_ds_iterator(array,iterator1,iterator2,iterator3):