def squared_root_normalization(x):
"""
Squared root normalization for convolution layers` output
first apply global average pooling followed by squared root on all elements
then l2 normalize the vector
:param x: input tensor, output of convolution layer
:return:
"""
x = GlobalAveragePooling2D()(x)
#output shape = (None, nc)
# x = K.sqrt(x)
#x = K.l2_normalize(x, axis=0)
return x
评论列表
文章目录