forked from jpata/particleflow
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically name training dir in pytorch pipeline (jpata#238)
* feat: specify number of samples as cmd line arg --ntrain: training samples --ntest validation samples * feat: automatically name training dir * fix: formatting * fix: test script passing old cmd line arg * fix: test only requires --load when not given --train
- Loading branch information
Showing
6 changed files
with
53 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from pathlib import Path | ||
import datetime | ||
import platform | ||
|
||
|
||
def create_experiment_dir(prefix=None, suffix=None): | ||
if prefix is None: | ||
train_dir = Path("experiments") / datetime.datetime.now().strftime("%Y%m%d_%H%M%S_%f") | ||
else: | ||
train_dir = Path("experiments") / (prefix + datetime.datetime.now().strftime("%Y%m%d_%H%M%S_%f")) | ||
|
||
if suffix is not None: | ||
train_dir = train_dir.with_name(train_dir.name + "." + platform.node()) | ||
|
||
train_dir.mkdir(parents=True) | ||
return str(train_dir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters