-
Notifications
You must be signed in to change notification settings - Fork 560
update selfplay to write 5% of games to a holdout directory #57
Conversation
amj
commented
Feb 5, 2018
- Changes the signature on preprocessing.make_dataset_from_selfplay to return the tf_examples instead of write a file
- sets a default holdout directory and makes the appropriate changes in rl_loop.py
- currently not an argument, nor is the amount of holdout a parameter. Should it be?
preprocessing.py
Outdated
''' | ||
Returns a set of tf.Examples. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return an iterable of tf.Example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
rl_loop.py
Outdated
@@ -28,6 +28,7 @@ | |||
BASE_DIR = "gs://{}".format(BUCKET_NAME) | |||
MODELS_DIR = os.path.join(BASE_DIR, 'models') | |||
SELFPLAY_DIR = os.path.join(BASE_DIR, 'games') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we're rejiggering our folder naming scheme, can we rename the selfplay dir? "games" is pretty nondescriptive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
preprocessing.make_dataset_from_selfplay(game_data, fname) | ||
tf_examples = preprocessing.make_dataset_from_selfplay(game_data) | ||
|
||
# Hold out 5% of games for evaluation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make 0.05 a flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gilding the lily a bit but done :)
@@ -118,10 +118,12 @@ def evaluate( | |||
def selfplay( | |||
load_file: "The path to the network model files", | |||
output_dir: "Where to write the games"="data/selfplay", | |||
holdout_dir: "Where to write the games"="data/holdout", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this written to local disk?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's written to wherever you pass it. This can be a gs:// path