# HG changeset patch # User Yoshua Bengio # Date 1209499757 14400 # Node ID 1729ad44f1758766a73aae841b9bad2be5a59d5b # Parent 66619ce44497f6c5ec3bac95c9fb6cc25bb391a7# Parent 70147d00615a74812e6d4b1261d1671529a7cd8b Automated merge with ssh://p-omega1@lgcm.iro.umontreal.ca/tlearn diff -r 66619ce44497 -r 1729ad44f175 .hgignore --- a/.hgignore Tue Apr 29 15:05:12 2008 -0400 +++ b/.hgignore Tue Apr 29 16:09:17 2008 -0400 @@ -1,2 +1,3 @@ syntax: glob *~ +*.pyc \ No newline at end of file diff -r 66619ce44497 -r 1729ad44f175 dataset.py --- a/dataset.py Tue Apr 29 15:05:12 2008 -0400 +++ b/dataset.py Tue Apr 29 16:09:17 2008 -0400 @@ -30,7 +30,7 @@ * for example in dataset([field1, field2,field3, ...]): * for val1,val2,val3 in dataset([field1, field2,field3]): * for minibatch in dataset.minibatches([field1, field2, ...],minibatch_size=N): - * for mini1,mini2,mini3 in dataset.minibatches([field1, field2, ...],minibatch_size=N): + * for mini1,mini2,mini3 in dataset.minibatches([field1, field2, field3], minibatch_size=N): * for example in dataset: print example['x'] * for x,y,z in dataset: @@ -46,8 +46,8 @@ To iterate over fields, one can do * for field in dataset.fields(): for field_value in field: # iterate over the values associated to that field for all the dataset examples - * for fields in dataset(field1,field2,...).fields() to select a subset of fields - * for fields in dataset.fields(field1,field2,...) to select a subset of fields + * for field in dataset(field1,field2,...).fields() to select a subset of fields + * for field in dataset.fields(field1,field2,...) to select a subset of fields and each of these fields is iterable over the examples: * for field_examples in dataset.fields(): for example_value in field_examples: diff -r 66619ce44497 -r 1729ad44f175 test_dataset.py --- a/test_dataset.py Tue Apr 29 15:05:12 2008 -0400 +++ b/test_dataset.py Tue Apr 29 16:09:17 2008 -0400 @@ -1,4 +1,4 @@ - +#!/bin/env python from dataset import * from math import * import numpy @@ -9,7 +9,9 @@ print a ds = ArrayDataSet(a,{'x':slice(3),'y':3,'z':[0,2]}) print "len(ds)=",len(ds) + assert(len(ds)==10) print "example 0 = ",ds[0] +# assert print "x=",ds["x"] print "x|y" for x,y in ds("x","y"):