The preprocessing.py module mainly deals with reading from and writing to TFRecords files, which is TensorFlow's native data-representation file format. When training AlphaGo Zero, we store MCTS self-play results and moves. As discussed, these then become the ground truths from which PolicyValueNetwork learns. TFRecords provides a convenient way to save historical moves and results from MCTS. When reading these from disk, preprocessing.py turns TFRecords into tf.train.Example, an in-memory representation of data that can be directly fed into tf.estimator.Estimator.
The following function reads from a TFRecords file. We first turn a given list of TFRecords into ...