March 2019
Intermediate to advanced
184 pages
4h 57m
English
We will now code a3c.py. This involves the following steps:
First, we need to import the necessary packages:
import numpy as npimport matplotlib.pyplot as pltimport tensorflow as tfimport gymimport threadingimport multiprocessingfrom random import choicefrom time import sleepfrom time import timefrom threading import Lockfrom utils import *
Then, we need to set the initializers for the weights and biases; specifically, we use the Xavier initializer for the weights and zero bias. For the last output layer of the network, the weights are uniform random numbers within a specified range:
xavier = tf.contrib.layers.xavier_initializer() ...
Read now
Unlock full access