comparison test_dataset.py @ 64:863da25a60f1

trying to fix infinite loop
author Yoshua Bengio <bengioy@iro.umontreal.ca>
date Fri, 02 May 2008 11:01:28 -0400
parents 14589f02a372
children d48eba49a2f4
comparison
equal deleted inserted replaced
63:14589f02a372 64:863da25a60f1
21 print "minibatch=",minibatch 21 print "minibatch=",minibatch
22 for var in minibatch: 22 for var in minibatch:
23 print "var=",var 23 print "var=",var
24 print "take a slice and look at field y",ds[1:6:2]["y"] 24 print "take a slice and look at field y",ds[1:6:2]["y"]
25 25
26 def test2():
27 a = numpy.random.rand(10,4)
28 print a
29 ds = ArrayDataSet(a,{'x':slice(3),'y':3,'z':[0,2]})
30 for x,z in ds[:3]('x','z'):
31 assert ds[i]['z'].all()==a[i][0:3:2].all()
32
26 def test_ArrayDataSet(): 33 def test_ArrayDataSet():
27 #don't test stream 34 #don't test stream
28 #tested only with float value 35 #tested only with float value
29 a = numpy.random.rand(10,4) 36 a = numpy.random.rand(10,4)
30 print a 37 print a
107 # - 'fieldtypes': a list of types (one per field) 114 # - 'fieldtypes': a list of types (one per field)
108 #* ds1 | ds2 | ds3 == ds.hstack([ds1,ds2,ds3]) 115 #* ds1 | ds2 | ds3 == ds.hstack([ds1,ds2,ds3])
109 #* ds1 & ds2 & ds3 == ds.vstack([ds1,ds2,ds3]) 116 #* ds1 & ds2 & ds3 == ds.vstack([ds1,ds2,ds3])
110 117
111 118
112 test_ArrayDataSet() 119 test2()
113 120
121 #test_ArrayDataSet()
122