1

I need to write a simple initializer for my convolutional layer biases. I am using tf.slim so I can specify the initializer when calling the convolutional layer, like so.

I want to replace the biases_initializer=init_ops.zeros_initializer() with my own custom function that just initializes the bias to a given constant, for example :

`biases_initializer=custom_initializer(value)`

where I can specify the value, for example value = -5.

Can anyone show me how this is done? I've spent about an hour reading through the existing initializers, but still don't know how to implement this simple function.

Qubix
  • 4,161
  • 7
  • 36
  • 73

1 Answers1

1

I finally found that it is not necessary to define that function since there already is a tf.constant_initializer. The above would just be achieved with:

biases_initializer = tf.constant_initializer(value)
Qubix
  • 4,161
  • 7
  • 36
  • 73