@@ -59,16 +59,21 @@ def identity_block(input_tensor, kernel_size, filters, stage, block):
59
59
bn_name_base = 'bn' + str (stage ) + block + '_branch'
60
60
61
61
x = layers .Conv2D (filters1 , (1 , 1 ),
62
+ kernel_initializer = 'he_normal' ,
62
63
name = conv_name_base + '2a' )(input_tensor )
63
64
x = layers .BatchNormalization (axis = bn_axis , name = bn_name_base + '2a' )(x )
64
65
x = layers .Activation ('relu' )(x )
65
66
66
67
x = layers .Conv2D (filters2 , kernel_size ,
67
- padding = 'same' , name = conv_name_base + '2b' )(x )
68
+ padding = 'same' ,
69
+ kernel_initializer = 'he_normal' ,
70
+ name = conv_name_base + '2b' )(x )
68
71
x = layers .BatchNormalization (axis = bn_axis , name = bn_name_base + '2b' )(x )
69
72
x = layers .Activation ('relu' )(x )
70
73
71
- x = layers .Conv2D (filters3 , (1 , 1 ), name = conv_name_base + '2c' )(x )
74
+ x = layers .Conv2D (filters3 , (1 , 1 ),
75
+ kernel_initializer = 'he_normal' ,
76
+ name = conv_name_base + '2c' )(x )
72
77
x = layers .BatchNormalization (axis = bn_axis , name = bn_name_base + '2c' )(x )
73
78
74
79
x = layers .add ([x , input_tensor ])
@@ -109,19 +114,24 @@ def conv_block(input_tensor,
109
114
bn_name_base = 'bn' + str (stage ) + block + '_branch'
110
115
111
116
x = layers .Conv2D (filters1 , (1 , 1 ), strides = strides ,
117
+ kernel_initializer = 'he_normal' ,
112
118
name = conv_name_base + '2a' )(input_tensor )
113
119
x = layers .BatchNormalization (axis = bn_axis , name = bn_name_base + '2a' )(x )
114
120
x = layers .Activation ('relu' )(x )
115
121
116
122
x = layers .Conv2D (filters2 , kernel_size , padding = 'same' ,
123
+ kernel_initializer = 'he_normal' ,
117
124
name = conv_name_base + '2b' )(x )
118
125
x = layers .BatchNormalization (axis = bn_axis , name = bn_name_base + '2b' )(x )
119
126
x = layers .Activation ('relu' )(x )
120
127
121
- x = layers .Conv2D (filters3 , (1 , 1 ), name = conv_name_base + '2c' )(x )
128
+ x = layers .Conv2D (filters3 , (1 , 1 ),
129
+ kernel_initializer = 'he_normal' ,
130
+ name = conv_name_base + '2c' )(x )
122
131
x = layers .BatchNormalization (axis = bn_axis , name = bn_name_base + '2c' )(x )
123
132
124
133
shortcut = layers .Conv2D (filters3 , (1 , 1 ), strides = strides ,
134
+ kernel_initializer = 'he_normal' ,
125
135
name = conv_name_base + '1' )(input_tensor )
126
136
shortcut = layers .BatchNormalization (
127
137
axis = bn_axis , name = bn_name_base + '1' )(shortcut )
@@ -214,6 +224,7 @@ def ResNet50(include_top=True,
214
224
x = layers .Conv2D (64 , (7 , 7 ),
215
225
strides = (2 , 2 ),
216
226
padding = 'valid' ,
227
+ kernel_initializer = 'he_normal' ,
217
228
name = 'conv1' )(x )
218
229
x = layers .BatchNormalization (axis = bn_axis , name = 'bn_conv1' )(x )
219
230
x = layers .Activation ('relu' )(x )
0 commit comments