stable-baselines3
jimjiang203 commited on
Commit
2fa2da2
·
verified ·
1 Parent(s): 648ae5c

Upload folder using huggingface_hub

Browse files
rl4greencrab/model/twoActEnv/.ipynb_checkpoints/model_rename-checkpoint.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ import os
3
+ import re
4
+
5
+ def main():
6
+ cwd = "."
7
+ for fname in os.listdir(cwd):
8
+ # Only work on .zip files
9
+ if not fname.endswith(".zip"):
10
+ continue
11
+
12
+ # Match pattern: Model-twoact...-<id>.zip
13
+ m = re.match(r'^(?P<model>[^-]+)-(twoactmonthnorm|twoactmonthsizenorm)-(?P<id>[12])\.zip$', fname)
14
+ if not m:
15
+ # Things like *-net.zip or anything else are skipped
16
+ print(f"Skipping (no rule): {fname}")
17
+ continue
18
+
19
+ model = m.group('model')
20
+ middle = m.group(2)
21
+ id_ = m.group('id')
22
+
23
+ # env
24
+ if "twoactmonthnorm" in middle:
25
+ env = "2obs"
26
+ elif "twoactmonthsizenorm" in middle:
27
+ env = "Nobs"
28
+ else:
29
+ # Shouldn't happen with current regex, but safe guard
30
+ print(f"Skipping (unknown env): {fname}")
31
+ continue
32
+
33
+ # var / noVar
34
+ if id_ == "1":
35
+ var_part = "noVar"
36
+ elif id_ == "2":
37
+ var_part = "Var"
38
+ else:
39
+ print(f"Skipping (unknown id): {fname}")
40
+ continue
41
+
42
+ new_name = f"{model}_{var_part}_{env}.zip"
43
+
44
+ if os.path.exists(os.path.join(cwd, new_name)):
45
+ print(f"NOT renaming {fname} -> {new_name} (target exists)")
46
+ continue
47
+
48
+ print(f"Renaming {fname} -> {new_name}")
49
+ os.rename(os.path.join(cwd, fname), os.path.join(cwd, new_name))
50
+
51
+ if __name__ == "__main__":
52
+ main()
rl4greencrab/model/twoActEnv/PPO-twoactmonthnorm-net.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f548813c590dd8d2db28ee4ae8d84c5ec08126e29a18fb8b21c716e0589ddcde
3
+ size 123819
rl4greencrab/model/twoActEnv/PPO-twoactmonthsizenorm-net.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:84fc86cbbae9a186e8e586a6c494d44982fdfad287fcbef0c18d1556fedbafad
3
+ size 155228
rl4greencrab/model/twoActEnv/PPO_Var_2obs.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:54f3e9140cbb95c77699da33c1bf6f383bae60a01c1a9ac6803650a136766d1d
3
+ size 158087
rl4greencrab/model/twoActEnv/PPO_Var_Nobs.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eb1c2adb2506c27b90a7dc3cf5231e944be32ce5a955cc641b2e21eadc78508b
3
+ size 191550
rl4greencrab/model/twoActEnv/PPO_noVar_2obs.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d1fc7f7bc8234b4c65834f415acec6b7e6fb1aad954433f627bf2478f1a44e7e
3
+ size 158087
rl4greencrab/model/twoActEnv/PPO_noVar_Nobs.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:12b5f767501af6eb54f5da9dd30de7983d034306ffb8d8ac60691775bbccd6fa
3
+ size 191466
rl4greencrab/model/twoActEnv/RecurrentPPO-twoactmonthnorm-net.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:42d847f77d16236853775bd8436313cc335aba0cc73af3e69c34ce9ed17b82cc
3
+ size 7714517
rl4greencrab/model/twoActEnv/RecurrentPPO-twoactmonthsizenorm-net.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:19b57bc98e218c4eb41297b80b73e3f605593b8c8e95238518fde444e5401878
3
+ size 8185493
rl4greencrab/model/twoActEnv/RecurrentPPO_Var_2obs.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2ad99ed4811bcf30cb066ec2012e750d1fe60070e95234ddcc6bf626593b543b
3
+ size 9891870
rl4greencrab/model/twoActEnv/RecurrentPPO_Var_Nobs.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2736701e136fdd5636734b5e693144a9b534b400f2d50e2b5c2eed332b655d86
3
+ size 10363039
rl4greencrab/model/twoActEnv/RecurrentPPO_noVar_2obs.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4c244abae42aa64f6ce86a3e0f6a3c22fc54b0786156a2d510b710d64adc5c3d
3
+ size 9891870
rl4greencrab/model/twoActEnv/RecurrentPPO_noVar_Nobs.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5f5980612886805143e354cc348cb8b499ba697889caaf8574d03f2091e150da
3
+ size 10362921
rl4greencrab/model/twoActEnv/TD3_Var_2obs.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4647fdd2419191bbe2ae3e51f85a552b18c5333d113d06729c6581cd1d9079b0
3
+ size 6152904
rl4greencrab/model/twoActEnv/TD3_Var_Nobs.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:96ff758b4abe2d8f75ae322d9b788e478bdeffc7b5c3f8c57a84bb78e5da9a9f
3
+ size 6525366
rl4greencrab/model/twoActEnv/TD3_noVar_2obs.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8f35d3f64e98d68a37241a5da678ee546b2e054f982613581719363f995275d2
3
+ size 6152886
rl4greencrab/model/twoActEnv/TD3_noVar_Nobs.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ff1739bfcef3e3f938bfec5c03bd3cb561fb50ed988f6dbcbe47014930008f34
3
+ size 6523751
rl4greencrab/model/twoActEnv/TQC_Var_2obs.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:98fe446c427df51ca28d8c189c2f3911acb79b3bc8c192d84bfec9d3854ec19e
3
+ size 3346666
rl4greencrab/model/twoActEnv/TQC_Var_Nobs.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4c80cf69be8a4f841e7de265ab6bf81b162e92d91c364d1f9a3f9dcc893f4c2c
3
+ size 3568830
rl4greencrab/model/twoActEnv/TQC_noVar_2obs.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2cb4cd761c78ac61ad0c03b8d589a9c33345e2548655a3b707d56c2b04bd4402
3
+ size 3346666
rl4greencrab/model/twoActEnv/TQC_noVar_Nobs.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bc6ab04e6696bdd6d4f722215ed20e052f33ca96307b8c4cf3d6f068bca518b4
3
+ size 3568767
rl4greencrab/model/twoActEnv/model_rename.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ import os
3
+ import re
4
+
5
+ def main():
6
+ cwd = "."
7
+ for fname in os.listdir(cwd):
8
+ # Only work on .zip files
9
+ if not fname.endswith(".zip"):
10
+ continue
11
+
12
+ # Match pattern: Model-twoact...-<id>.zip
13
+ m = re.match(r'^(?P<model>[^-]+)-(twoactmonthnorm|twoactmonthsizenorm)-(?P<id>[12])\.zip$', fname)
14
+ if not m:
15
+ # Things like *-net.zip or anything else are skipped
16
+ print(f"Skipping (no rule): {fname}")
17
+ continue
18
+
19
+ model = m.group('model')
20
+ middle = m.group(2)
21
+ id_ = m.group('id')
22
+
23
+ # env
24
+ if "twoactmonthnorm" in middle:
25
+ env = "2obs"
26
+ elif "twoactmonthsizenorm" in middle:
27
+ env = "Nobs"
28
+ else:
29
+ # Shouldn't happen with current regex, but safe guard
30
+ print(f"Skipping (unknown env): {fname}")
31
+ continue
32
+
33
+ # var / noVar
34
+ if id_ == "1":
35
+ var_part = "noVar"
36
+ elif id_ == "2":
37
+ var_part = "Var"
38
+ else:
39
+ print(f"Skipping (unknown id): {fname}")
40
+ continue
41
+
42
+ new_name = f"{model}_{var_part}_{env}.zip"
43
+
44
+ if os.path.exists(os.path.join(cwd, new_name)):
45
+ print(f"NOT renaming {fname} -> {new_name} (target exists)")
46
+ continue
47
+
48
+ print(f"Renaming {fname} -> {new_name}")
49
+ os.rename(os.path.join(cwd, fname), os.path.join(cwd, new_name))
50
+
51
+ if __name__ == "__main__":
52
+ main()