April 2019
Intermediate to advanced
212 pages
5h 34m
English
We first initialize the input layer using the tf.placeholder() function. We call this tensor a placeholder because its value hasn't been assigned yet.
Using a placeholder lets us build the structure of our computation graph without having the data yet. The results of evaluating this node will be fed into the output layer using the feed_dict() argument when the training session is run.
The state value is encoded as a one-hot vector of the shape, [1, observation_space]. We can get the length of the observation space with env.observation_space.n, as follows:
tf.reset_default_graph()inputs = tf.placeholder(shape[1,env.observation_space.n], \ dtype=tf.float32)
We initialize the weights as a vector of the size, [observation_space, ...
Read now
Unlock full access