# HG changeset patch # User James Bergstra # Date 1242334694 14400 # Node ID 651eb6506d91da44344845d8cf6d83ab27da786c # Parent 49e531f7b0ba52a5c99b7c99d335a9e37c8ec372 do not read data file on import diff -r 49e531f7b0ba -r 651eb6506d91 pylearn/datasets/tzanetakis.py --- a/pylearn/datasets/tzanetakis.py Thu May 14 16:54:59 2009 -0400 +++ b/pylearn/datasets/tzanetakis.py Thu May 14 16:58:14 2009 -0400 @@ -88,8 +88,6 @@ assert len(path) == 1000 return path, label - nclasses = 10 - class_idx_dict = dict(blues=numpy.asarray(0), classical=1, country=2, @@ -108,8 +106,9 @@ for i, c in enumerate(classes): self.class_idx_dict[c] = numpy.asarray(i, dtype='int64') - def __len__(self): - return len(self.path) + n_examples = property(lambda self: len(self.path)) + nclasses = property(lambda self: 10) + def make_node(self, idx): idx_ = theano.tensor.as_tensor_variable(idx) @@ -127,5 +126,5 @@ def grad(self, inputs, g_output): return [None for i in inputs] -tzanetakis_example = TzanetakisExample() +#tzanetakis_example = TzanetakisExample() #requires reading a data file