You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code in pylearn2/cross_validation/dataset_iterators.py calls n = dataset.X.shape[0] in many places. These statements should be changed to n = dataset.get_num_examples() because that's the standard way according to the base interface.
The code of DatasetCV class in pylearn2/cross_validation/dataset_iterators.py is specialized to the DenseDesignMatrix constructors and it does not work with VectorSpacesDataset. In the absence of a standard constructor in the Dataset abstract interface, I added some exception handling and an assertion to check that the type of datasets used during cross validation is the same as the original dataset. This is not a great solution but at least the assertion is useful.
Another thing (not an issue) is that the following check in the constructor for FiniteDatasetIterator in pylearn2/utils/iteration.py throws up unless the yaml file is formatted with !!python/tuple directives for the data_specs. A helpful message could be added at this point suggesting this fix.
# Code that throws up when source is list instead of tuple.898ifnotisinstance(source, tuple):
899source= (source,)
...
904assertlen(convert) ==len(source), "Try and change dataset data_specs"+ \
" in yaml file to !!python/tuple [ 'a', 'b']"
pylearn2/cross_validation/dataset_iterators.py
callsn = dataset.X.shape[0]
in many places. These statements should be changed ton = dataset.get_num_examples()
because that's the standard way according to the base interface.DatasetCV
class inpylearn2/cross_validation/dataset_iterators.py
is specialized to theDenseDesignMatrix
constructors and it does not work withVectorSpacesDataset
. In the absence of a standard constructor in theDataset
abstract interface, I added some exception handling and an assertion to check that the type of datasets used during cross validation is the same as the original dataset. This is not a great solution but at least the assertion is useful.FiniteDatasetIterator
inpylearn2/utils/iteration.py
throws up unless the yaml file is formatted with!!python/tuple
directives for thedata_specs
. A helpful message could be added at this point suggesting this fix.The text was updated successfully, but these errors were encountered: