Introduction to Tensorflow Assignment, Exercise 4, initializing parameters

I’m unsure what I need to be doing here. If the initializer function drawing samples for us?
This is my code, any advice on what the right answer is ?

W1 = tf.Variable(initializer(shape=(tf.zeros(25,12288)))
b1 = tf.Variable(initializer(shape=(tf.zeros(25,1)))
W2 = tf.Variable(initializer(shape=(tf.zeros(12,25)))
b2 = tf.Variable(initializer(shape=(tf.zeros(12,1)))
W3 = tf.Variable(initializer(shape=(tf.zeros(6,12))
b3 = tf.Variable(initializer(shape=(tf.zeros(6,1))

Hi @Zekromblue, welcome to Discourse.

You need to initialize all vectors and matrices using the GlorotNormal initializer instanciated before.

The initializer receives as a parameter a tuple with the desired shape. You can see examples here.

1 Like

if it is initialization to zeros ,what is use of initializer function?

1 Like