DigitMagazine

Fully connected layer in tensorflow

Jul 25th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. def create_fc_layer(input,num_inputs,num_outputs,use_relu=True):
  2. weights = create_weights(shape=[num_inputs, num_outputs])
  3. biases = create_biases(num_outputs)
  4. layer = tf.matmul(input, weights) + biases
  5. if use_relu:
  6. layer = tf.nn.relu(layer)
  7. return layer
Add Comment
Please, Sign In to add comment