# HG changeset patch # User Frederic Bastien # Date 1210104197 14400 # Node ID 4537ac6303483aedf3c34a5178b7d0b799096169 # Parent a1740a99b81fd955098fa500bf14266ab1ec1060 modifed test to accomodate the last change in dataset.py. i.e. minibatch without a fixed number of batch return an incomplete minibatch at the end to stop at the end of the dataset. diff -r a1740a99b81f -r 4537ac630348 test_dataset.py --- a/test_dataset.py Tue May 06 16:01:53 2008 -0400 +++ b/test_dataset.py Tue May 06 16:03:17 2008 -0400 @@ -112,50 +112,68 @@ assert i==len(ds) del x,y,i + def test_minibatch_size(minibatch,minibatch_size,len_ds,nb_field,nb_iter_finished): + ##full minibatch or the last minibatch + for idx in range(nb_field): + test_minibatch_field_size(minibatch[idx],minibatch_size,len_ds,nb_iter_finished) + del idx + def test_minibatch_field_size(minibatch_field,minibatch_size,len_ds,nb_iter_finished): + assert len(minibatch_field)==minibatch_size or ((nb_iter_finished*minibatch_size+len(minibatch_field))==len_ds and len(minibatch_field)