일반화 된 일괄 정규화 함수를 작성하려고합니다. Tensorflow.치수 일괄 정규화
나는 매우 친절한이 article에서 일괄 정규화를 배웁니다.
는 I은 스케일 및 베타 변수의 측정에 문제가 내 케이스 배치 정상화 내가 컨벌루션 층을의 출력으로 여태 경우 각 컨벌루션 층 각각의 활성화에 적용 크기 tersor :
[57,57,96]
난 올바른 스케일 및 베타는 길쌈 출력 층과 동일한 치수를 가질 것을 필요? 여기
내 기능, 프로그램 작품입니다 만tf.nn.batch_normalization
의 문서에서 def batch_normalization_layer(batch):
# Calculate batch mean and variance
batch_mean, batch_var = tf.nn.moments(batch, axes=[0, 1, 2])
# Apply the initial batch normalizing transform
scale = tf.Variable(tf.ones([batch.get_shape()[1],batch.get_shape()[2],batch.get_shape()[3]]))
beta = tf.Variable(tf.zeros([batch.get_shape()[1],batch.get_shape()[2],batch.get_shape()[3]]))
normalized_batch = tf.nn.batch_normalization(batch, batch_mean, batch_var, beta, scale, 0.0001)
return normalized_batch