Skip to content

Instantly share code, notes, and snippets.

@SuvroBaner
Created December 31, 2019 11:27
Show Gist options
  • Save SuvroBaner/5bf2364db82f11dd65db962ac63e303c to your computer and use it in GitHub Desktop.
Save SuvroBaner/5bf2364db82f11dd65db962ac63e303c to your computer and use it in GitHub Desktop.
def initialize_parameters():
W1 = tf.get_variable("W1", [25, 12288], initializer = tf.contrib.layers.xavier_initializer(seed = 1))
b1 = tf.get_variable("b1", [25, 1], initializer = tf.zeros_initializer())
W2 = tf.get_variable("W2", [12, 25], initializer = tf.contrib.layers.xavier_initializer(seed = 1))
b2 = tf.get_variable("b2", [12, 1], initializer = tf.zeros_initializer())
W3 = tf.get_variable("W3", [6,12], initializer = tf.contrib.layers.xavier_initializer(seed = 1))
b3 = tf.get_variable("b3", [6,1], initializer = tf.zeros_initializer())
parameters = {"W1" : W1,
"b1" : b1,
"W2" : W2,
"b2" : b2,
"W3" : W3,
"b3" : b3}
return parameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment