preprocessing.py

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.

 tf_records usually have filenames that end with *.tfrecord.zz.

The following function reads from a TFRecords file. We first turn a given list of TFRecords into ...

Get Python Reinforcement Learning Projects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.