Created
April 22, 2018 16:53
-
-
Save dpfrakes/70cfeb3da2def863b57310e3198cdc40 to your computer and use it in GitHub Desktop.
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
import os | |
from datetime import datetime as dt | |
import numpy as np | |
def save_results(agent, arr): | |
# Save array of Q updates (or anything else) and accompanying agent metadata | |
filename = '{}_{}'.format(dt.now().strftime('%H%M%S'), agent.algo_name) | |
# Save | |
np.save(os.path.join('.', 'saved_agents', filename), arr) | |
f = open(os.path.join('.', 'saved_agents', '{}.txt'.format(filename)), 'w') | |
for attr, value in player.__dict__.items(): | |
f.write(attr, value) | |
return filename |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment