Skip to content

Commit 76ed60d

Browse files
committed
add bn to ca
1 parent f433e0d commit 76ed60d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nets/attention.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import tensorflow as tf
44
from keras import backend as K
55
from keras.layers import (Activation, Add, Concatenate, Conv1D, Conv2D, Dense,
6-
GlobalAveragePooling2D, GlobalMaxPooling2D, Lambda,
6+
GlobalAveragePooling2D, GlobalMaxPooling2D, Lambda, BatchNormalization,
77
Reshape, multiply)
88

99

@@ -113,6 +113,7 @@ def ca_block(input_feature, ratio=16, name=""):
113113

114114
x_cat_conv_relu = Concatenate(axis=2)([x_w, x_h])
115115
x_cat_conv_relu = Conv2D(channel // ratio, kernel_size=1, strides=1, use_bias=False, name = "ca_block_conv1_"+str(name))(x_cat_conv_relu)
116+
x_cat_conv_relu = BatchNormalization(name = "ca_block_bn_"+str(name))(x_cat_conv_relu)
116117
x_cat_conv_relu = Activation('relu')(x_cat_conv_relu)
117118

118119
x_cat_conv_split_h, x_cat_conv_split_w = Lambda(lambda x: tf.split(x, num_or_size_splits=[h, w], axis=2))(x_cat_conv_relu)

0 commit comments

Comments
 (0)