Skip to content

Instantly share code, notes, and snippets.

@d0znpp
Created December 12, 2017 00:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d0znpp/db1caaefd6c9ed5c72e65721fbd859bb to your computer and use it in GitHub Desktop.
Save d0znpp/db1caaefd6c9ed5c72e65721fbd859bb to your computer and use it in GitHub Desktop.
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