March 2019
Intermediate to advanced
184 pages
4h 57m
English
We will now describe the Worker() class, which each worker thread will use. First, we define the __init__() constructor for the class. Inside of it, we define the worker name, the number, the model path, the Adam optimizer, the count of global episodes, and the operator to increment it:
class Worker(): def __init__(self,env,name,s_size,a_size,trainer,model_path,global_episodes): self.name = "worker_" + str(name) self.number = name self.model_path = model_path self.trainer = trainer self.global_episodes = global_episodes self.increment = self.global_episodes.assign_add(1)
We also create the local instance of the AC class, with the appropriate arguments passed in. We then create a TensorFlow operation to copy the model parameters ...
Read now
Unlock full access