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

Fix decode training parser #124

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions tf/chunkparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ def __init__(self,
expected_input_format,
shuffle_size=1,
sample=1,
buffer_size=1,
batch_size=256,
workers=None):
"""
Read data and yield batches of raw tensors.

'chunks' list of chunk filenames.
'expected_input_format' is an int, one of [1, 2, 3]. Determines the middle planes in convert_v5_to_tuple
'shuffle_size' is the size of the shuffle buffer.
'sample' is the rate to down-sample.
'workers' is the number of child workers to use.
Expand All @@ -99,7 +99,7 @@ def __init__(self,
chunkdata: type Bytes. Multiple records of v5 format where each record
consists of (state, policy, result, q)

raw: A byte string holding raw tensors contenated together. This is
raw: A byte string holding raw tensors concatenated together. This is
used to pass data from the workers to the parent. Exists because
TensorFlow doesn't have a fast way to unpack bit vectors. 7950 bytes
long.
Expand Down
3 changes: 2 additions & 1 deletion tf/decode_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,11 @@ def describe(self):


class TrainingStep:
def __init__(self, version):
def __init__(self, version, input_format=1):
self.version = version
# Construct a fake parser just to get access to it's variables
self.parser = chunkparser.ChunkParser(chunkparser.ChunkDataSrc([]),
expected_input_format=input_format,
workers=1)
self.NUM_HIST = 8
self.NUM_PIECE_TYPES = 6
Expand Down