From 806afe13365bc5921417628e9ecb44d192237ed4 Mon Sep 17 00:00:00 2001 From: David Schneider-Joseph Date: Fri, 2 Oct 2015 00:35:59 -0700 Subject: [PATCH 1/3] record identifying information with each run --- deep_q_rl/ale_agent.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/deep_q_rl/ale_agent.py b/deep_q_rl/ale_agent.py index 5ec16b4..7670414 100755 --- a/deep_q_rl/ale_agent.py +++ b/deep_q_rl/ale_agent.py @@ -15,6 +15,8 @@ import ale_data_set +import pipes +import subprocess import sys sys.setrecursionlimit(10000) @@ -39,7 +41,7 @@ def __init__(self, q_network, epsilon_start, epsilon_min, self.image_height = self.network.input_height # CREATE A FOLDER TO HOLD RESULTS - time_str = time.strftime("_%m-%d-%H-%M_", time.gmtime()) + time_str = time.strftime("_%m-%d-%H-%M-%S_", time.gmtime()) self.exp_dir = self.exp_pref + time_str + \ "{}".format(self.network.lr).replace(".", "p") + "_" \ + "{}".format(self.network.discount).replace(".", "p") @@ -49,6 +51,15 @@ def __init__(self, q_network, epsilon_start, epsilon_min, except OSError: os.makedirs(self.exp_dir) + # Record command line and repository info. + with open(os.path.join(self.exp_dir, 'cmdline'), 'w') as f: + f.write(' '.join(pipes.quote(x) for x in sys.argv)) + f.write('\n') + with open(os.path.join(self.exp_dir, 'git-status'), 'w') as f: + f.write(subprocess.check_output(['git', 'status'])) + with open(os.path.join(self.exp_dir, 'git-diff'), 'w') as f: + f.write(subprocess.check_output(['git', 'diff', 'HEAD'])) + self.num_actions = self.network.num_actions From 71061e912c138c1a00bac65e41d15634e14f0585 Mon Sep 17 00:00:00 2001 From: David Schneider-Joseph Date: Fri, 2 Oct 2015 00:49:07 -0700 Subject: [PATCH 2/3] add rev-parse also --- deep_q_rl/ale_agent.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deep_q_rl/ale_agent.py b/deep_q_rl/ale_agent.py index 7670414..fc3b04b 100755 --- a/deep_q_rl/ale_agent.py +++ b/deep_q_rl/ale_agent.py @@ -55,6 +55,8 @@ def __init__(self, q_network, epsilon_start, epsilon_min, with open(os.path.join(self.exp_dir, 'cmdline'), 'w') as f: f.write(' '.join(pipes.quote(x) for x in sys.argv)) f.write('\n') + with open(os.path.join(self.exp_dir, 'git-rev-parse'), 'w') as f: + f.write(subprocess.check_output(['git', 'rev-parse', 'HEAD'])) with open(os.path.join(self.exp_dir, 'git-status'), 'w') as f: f.write(subprocess.check_output(['git', 'status'])) with open(os.path.join(self.exp_dir, 'git-diff'), 'w') as f: From 1e172cb0931857e236b9271c53818e46e42e1f75 Mon Sep 17 00:00:00 2001 From: David Schneider-Joseph Date: Fri, 2 Oct 2015 00:57:55 -0700 Subject: [PATCH 3/3] remove unnecessary git status --- deep_q_rl/ale_agent.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/deep_q_rl/ale_agent.py b/deep_q_rl/ale_agent.py index fc3b04b..ea0f5a8 100755 --- a/deep_q_rl/ale_agent.py +++ b/deep_q_rl/ale_agent.py @@ -57,8 +57,6 @@ def __init__(self, q_network, epsilon_start, epsilon_min, f.write('\n') with open(os.path.join(self.exp_dir, 'git-rev-parse'), 'w') as f: f.write(subprocess.check_output(['git', 'rev-parse', 'HEAD'])) - with open(os.path.join(self.exp_dir, 'git-status'), 'w') as f: - f.write(subprocess.check_output(['git', 'status'])) with open(os.path.join(self.exp_dir, 'git-diff'), 'w') as f: f.write(subprocess.check_output(['git', 'diff', 'HEAD']))