ccm commited on
Commit
fa3addb
·
1 Parent(s): 2130d1b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -5
app.py CHANGED
@@ -17,8 +17,14 @@ def load_data():
17
 
18
  from datasets import load_dataset
19
 
20
- curves = load_dataset("cmudrc/wave-energy", data_files="curves.zip", split='train').to_pandas().drop(labels="index", axis=1)
21
- geometry = load_dataset("cmudrc/wave-energy", data_files="geometry.zip", split='train').to_pandas().drop(labels="index", axis=1)
 
 
 
 
 
 
22
 
23
  # Open all the files we downloaded at the beginning and take out hte good bits
24
  # curves = data.iloc[:, [i for i in range(1, 3*64+1)]]
@@ -30,13 +36,13 @@ def load_data():
30
  G = 32
31
 
32
  # flattened_curves = curves.values / 1000000
33
- curvey_curves = [c.reshape([D, F])/1000000 for c in curves.values]
34
 
35
  # flattened_geometry = geometry.values
36
- round_geometry = [g.reshape([G, G, G]) for g in geometry.values]
37
 
38
  # Return good bits to user
39
- return curvey_curves, round_geometry, S, N, D, F, G, curves.values/1000000, geometry.values
40
 
41
  # Disable eager execution because its bad
42
  from tensorflow.python.framework.ops import disable_eager_execution
 
17
 
18
  from datasets import load_dataset
19
 
20
+
21
+ data = load_dataset("cmudrc/wave-energy", data_files="data.zip")
22
+ curvey_curves = [numpy.array(x)/1000000 for x in data['curves']]
23
+ round_geometry = [numpy.array(x) for x in data['geometry']]
24
+ geometry = [x.flatten() for x in round_geometry]
25
+ curves = [x.flatten() for x in curvey_curves]
26
+ # curves = load_dataset("cmudrc/wave-energy", data_files="curves.zip", split='train').to_pandas().drop(labels="index", axis=1)
27
+ # geometry = load_dataset("cmudrc/wave-energy", data_files="geometry.zip", split='train').to_pandas().drop(labels="index", axis=1)
28
 
29
  # Open all the files we downloaded at the beginning and take out hte good bits
30
  # curves = data.iloc[:, [i for i in range(1, 3*64+1)]]
 
36
  G = 32
37
 
38
  # flattened_curves = curves.values / 1000000
39
+ # curvey_curves = [c.reshape([D, F])/1000000 for c in curves.values]
40
 
41
  # flattened_geometry = geometry.values
42
+ # round_geometry = [g.reshape([G, G, G]) for g in geometry.values]
43
 
44
  # Return good bits to user
45
+ return curvey_curves, round_geometry, S, N, D, F, G, curves, geometry
46
 
47
  # Disable eager execution because its bad
48
  from tensorflow.python.framework.ops import disable_eager_execution