O'Reilly logo

Python Reinforcement Learning Projects by Rajalingappaa Shanmugamani, Yang Wenzhuo, Sean Saito

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

controller.py

First, we start with some import statements and helper functions that help us check directory paths and find the latest model version:

import argparseimport loggingimport osimport randomimport socketimport sysimport timeimport arghimport tensorflow as tffrom tensorflow import gfilefrom tqdm import tqdmimport alphagozero_agentimport networkimport preprocessingfrom config import GLOBAL_PARAMETER_STOREfrom constants import PATHSfrom alphagozero_agent import play_matchfrom network import PolicyValueNetworkfrom utils import logged_timer as timerfrom utils import print_flags, generate, detect_model_name, detect_model_versionlogging.basicConfig( level=logging.DEBUG, handlers=[logging.StreamHandler(sys.stdout)], format='%(asctime)s ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required