Skip to content

Instantly share code, notes, and snippets.

@dmesquita
Last active October 24, 2017 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmesquita/1e90030d52e01f7c96f48b698a900595 to your computer and use it in GitHub Desktop.
Save dmesquita/1e90030d52e01f7c96f48b698a900595 to your computer and use it in GitHub Desktop.
Big Picture Deep Learning with Pytorch
def multilayer_perceptron(input_tensor, weights, biases):
layer_1_multiplication = tf.matmul(input_tensor, weights['h1'])
layer_1_addition = tf.add(layer_1_multiplication, biases['b1'])
layer_1_activation = tf.nn.relu(layer_1_addition)
layer_2_multiplication = tf.matmul(layer_1_activation, weights['h2'])
layer_2_addition = tf.add(layer_2_multiplication, biases['b2'])
layer_2_activation = tf.nn.relu(layer_2_addition)
out_layer_multiplication = tf.matmul(layer_2_activation, weights['out'])
out_layer_addition = out_layer_multiplication + biases['out']
return out_layer_addition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment