1
votes

I'm trying to convert a Caffe model to tensorflow. In Caffe my convolutions are initialized like this:

weight_filler {
  type: "gaussian"
  std: 0.01
}
bias_filler {
  type: "constant"
  value: 0
}

How can I get the same initialization in Tensorflow?

1

1 Answers

1
votes

With tf.truncated_normal you can get random values from a truncated random distribution, thus:

shape = [10,10] # variable shape
weight = tf.Variable(tf.truncated_normal(shape, mean=0.0, stddev=0.01))
bias = tf.Variable(0.)