Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. ::
  2. ::
  3.  
  4. with tf.name_scope("inputs"):
  5. X = tf.placeholder(tf.float32, shape=[None, n_inputs], name="X")
  6. X_reshaped = tf.reshape(X, shape=[-1, height, width, channels])
  7. y = tf.placeholder(tf.int32, shape=[None], name="y")
  8. training = tf.placeholder_with_default(False, shape=[], name='training')
  9.  
  10. ::
  11. ::
  12.  
  13. pool2_fmaps = conv2_fmaps
  14. with tf.name_scope("pool2"):
  15. pool2 = tf.layers.max_pooling2d(inputs=conv2, pool_size=[2, 2], strides=2)
  16. pool2_flat = tf.reshape(pool2, shape=[-1, 8 * 1 * pool2_fmaps])
  17. pool2_flat_drop = tf.layers.dropout(pool2_flat, conv2_dropout_rate, training=training)
  18.  
  19. n_fc1 = 512
  20. fc1_dropout_rate = 0.4
  21. with tf.name_scope("fc1"):
  22. fc1 = tf.layers.dense(pool2_flat_drop, n_fc1, activation=tf.nn.relu, name="fc1")
  23. fc1_drop = tf.layers.dropout(fc1, fc1_dropout_rate, training=training)
  24.  
  25. with tf.name_scope("output"):
  26. logits = tf.layers.dense(fc1_drop, n_outputs, name="output")
  27. Y_proba = tf.nn.softmax(logits, name="Y_proba")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement