Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def policy_network(state, max_layers):
with tf.name_scope("policy_network"):
nas_cell = tf.contrib.rnn.NASCell(4*max_layers)
outputs, state = tf.nn.dynamic_rnn(
nas_cell,
tf.expand_dims(state, -1),
dtype=tf.float32
)
bias = tf.Variable([0.05]*4*max_layers)
outputs = tf.nn.bias_add(outputs, bias)
return outputs[:, -1:, :]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment