-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathdata_reader.py
More file actions
35 lines (25 loc) · 732 Bytes
/
data_reader.py
File metadata and controls
35 lines (25 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import cPickle
import os
import numpy as np
def load_data():
X = []
Y = []
for path in os.listdir('all_compressed_features'):
data_point = cPickle.load( open( os.path.join('all_compressed_features',path), "rb" ) )
X.append(data_point['x'])
Y.append(data_point['y'])
count = 0
for path in os.listdir('acf2'):
if count == 23:
break
count += 1
data_point = cPickle.load( open( os.path.join('acf2',path), "rb" ) )
X.append(data_point['x'])
Y.append(data_point['y'])
return np.asarray(X),np.asarray(Y)
if __name__ == '__main__':
X,Y = load_data()
print len(X)
print len(Y)
print Y
print X[0].shape