(data, axis, num_samples)
return mean, std
Computes data mean and std.
Computes data mean and std.
Computes data mean and std .
def compute_data_mean_and_std(data, axis, num_samples):
  """Computes data mean and std."""
  with tf.Session() as sess:
    sess.run([
        tf.global_variables_initializer(),
        tf.local_variables_initializer(),
        tf.tables_initializer()
    ])
    with tf_slim.queues.QueueRunners(sess):
      data_value = np.concatenate(
          [sess.run(data) for _ in range(num_samples)], axis=0)
  mean = np.mean(data_value, axis=tuple(axis), keepdims=True)
  std = np.std(data_value, axis=tuple(axis), keepdims=True)
  return mean, std
def compute_data_mean_and_std ( data , axis , num_samples ) : with tf . Session ( ) as sess : sess . run ( [ tf . global_variables_initializer ( ) , tf . local_variables_initializer ( ) , tf . tables_initializer ( ) ] ) with tf_slim . queues . QueueRunners ( sess ) : data_value = np . concatenate ( [ sess . run ( data ) for _ in range ( num_samples ) ] , axis = 0 ) mean = np . mean ( data_value , axis = tuple ( axis ) , keepdims = True ) std = np . std ( data_value , axis = tuple ( axis ) , keepdims = True ) return mean , std