We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a51061 commit 22d0b26Copy full SHA for 22d0b26
inclearn/results_utils.py
@@ -15,10 +15,18 @@ def get_template_results(args):
15
16
def save_results(results, label):
17
del results["config"]["device"]
18
- file_path = "{}_{}.json".format(utils.get_date(), label)
19
- with open(os.path.join("results", file_path), "w+") as f:
20
- json.dump(results, f)
21
+ folder_path = os.path.join("results", label)
+ if not os.path.exists(folder_path):
+ os.makedirs(folder_path)
22
+
23
+ file_path = "{date}_{label}_{seed}.json".format(
24
+ date=utils.get_date(),
25
+ label=label,
26
+ seed=results["config"]["seed"]
27
+ )
28
+ with open(os.path.join(folder_path, file_path), "w+") as f:
29
+ json.dump(results, f)
30
31
32
def plot(paths, save_path=None):
0 commit comments