Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

record identifying information with each experiment #49

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion deep_q_rl/ale_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

import ale_data_set

import pipes
import subprocess
import sys
sys.setrecursionlimit(10000)

Expand All @@ -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")
Expand All @@ -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-rev-parse'), 'w') as f:
f.write(subprocess.check_output(['git', 'rev-parse', 'HEAD']))
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


Expand Down