(x, nb_filter, strides=(1,1), pooling=False, bn=False, dropout_rate=None, weight_decay=0)
| 8 | |
| 9 | |
| 10 | def standard_conv_block(x, nb_filter, strides=(1,1), pooling=False, bn=False, dropout_rate=None, weight_decay=0): |
| 11 | x = Conv2D(nb_filter, (3, 3), |
| 12 | strides=strides, |
| 13 | padding="same", |
| 14 | kernel_regularizer=l2(weight_decay))(x) |
| 15 | if bn: |
| 16 | x = BatchNormalization(mode=2, axis=1)(x) |
| 17 | x = Activation("relu")(x) |
| 18 | if pooling: |
| 19 | x = MaxPooling2D()(x) |
| 20 | if dropout_rate: |
| 21 | x = Dropout(dropout_rate)(x) |
| 22 | return x |
| 23 | |
| 24 | |
| 25 | def FCN(img_dim, nb_classes, model_name="FCN"): |