TobiTob commited on
Commit
ea37106
1 Parent(s): 9d5d2b9

Delete check_data_structure.py

Browse files
Files changed (1) hide show
  1. check_data_structure.py +0 -65
check_data_structure.py DELETED
@@ -1,65 +0,0 @@
1
- import os
2
- import pickle
3
-
4
- if __name__ == '__main__':
5
-
6
- file = "s_month.pkl"
7
- with open(file, "rb") as f:
8
- data = pickle.load(f)
9
-
10
- print("data ", type(data), "length: ", len(data))
11
- dict0 = data[0]
12
- print("data[0] ", type(dict0), "length: ", len(dict0))
13
- print("data[0].keys() ", dict0.keys())
14
- print()
15
- observations = dict0['observations']
16
- print("observations ", type(observations), "length: ", len(observations))
17
- observations0 = observations[0]
18
- print("observations[0] ", type(observations0), "length: ", len(observations0))
19
- observations00 = observations[0][0]
20
- print("observations[0][0] ", type(observations00))
21
- print()
22
- next_observations = dict0['next_observations']
23
- print("next_observations ", type(next_observations), "length: ", len(next_observations))
24
- next_observations0 = next_observations[0]
25
- print("next_observations[0] ", type(next_observations0), "length: ", len(next_observations0))
26
- next_observations00 = next_observations[0][0]
27
- print("next_observations[0][0] ", type(next_observations00))
28
- print()
29
- actions = dict0['actions']
30
- print("actions ", type(actions), "length: ", len(actions))
31
- actions0 = actions[0]
32
- print("actions[0] ", type(actions0), "length: ", len(actions0))
33
- actions00 = actions[0][0]
34
- print("actions[0][0] ", type(actions00))
35
- print()
36
- rewards = dict0['rewards']
37
- print("rewards ", type(rewards), "length: ", len(rewards))
38
- rewards0 = rewards[0]
39
- print("rewards[0] ", type(rewards0))
40
- print()
41
- terminals = dict0['terminals']
42
- print("terminals ", type(terminals), "length: ", len(terminals))
43
- terminals0 = terminals[0]
44
- print("terminals[0] ", type(terminals0))
45
- print()
46
- print("========================= Data Size =============================")
47
- length = 0
48
- for d in data:
49
- if len(d["observations"]) > length:
50
- length = len(d["observations"])
51
-
52
- print("Amount Of Sequences: ", len(data))
53
- print("Longest Sequence: ", length)
54
-
55
- file_size = os.stat(file).st_size
56
- if file_size > 1e+6:
57
- string_byte = "(" + str(round(file_size / 1e+6)) + " MB)"
58
- else:
59
- string_byte = "(" + str(round(file_size / 1e+3)) + " kB)"
60
- print(file, string_byte)
61
-
62
- print(data[0]["observations"][0][:3])
63
-
64
-
65
-