Mercurial > pylearn
diff dataset.py @ 320:b1da46b9b901
bug fixed when initializing NArraysDataSet with 1-d arrays. This now raises an Exception
author | Thierry Bertin-Mahieux <bertinmt@iro.umontreal.ca> |
---|---|
date | Wed, 11 Jun 2008 17:11:37 -0400 |
parents | 6441e568745e |
children | f03ae06fadc8 |
line wrap: on
line diff
--- a/dataset.py Wed Jun 11 17:05:56 2008 -0400 +++ b/dataset.py Wed Jun 11 17:11:37 2008 -0400 @@ -1061,6 +1061,9 @@ assert len(fieldnames) > 0 all_matrix_sizes = map(lambda x : numpy.asmatrix(x).shape[0] , data_arrays) num_examples = max(all_matrix_sizes) + if num_examples == 1 : + # problem, do we transpose all arrays? is there only one example? + raise Exception("wrong initialization, unknow behaviour with 1-d arrays") self._fieldnames = fieldnames self._datas = [] for k in range(len(data_arrays)) :