Python Reinforcement Learning
上QQ阅读APP看书,第一时间看更新

Placeholders

Think of placeholders as variables where you only define the type and dimension but will not assign the value. Placeholders are defined with no values. Values for the placeholders will be fed at runtime. Placeholders have an optional argument called shape, which specifies the dimensions of the data. If the shape is set to None then we can feed data of any size at runtime. Placeholders can be defined using the tf.placeholder() function:

x = tf.placeholder("float", shape=None)

To put it in simple terms, we use tf.Variable to store the data and tf.placeholder for feeding the external data.