def create_feature_extractor(): from tensorflow.python.keras.applications import resnet x = tf.keras.Input([None, None, 1]) y = x y = tf.keras.layers.Conv2D(16, 3, padding='SAME')(y) y = resnet.stack2(y, 16, 3, stride1=2, name='stack1') y = resnet.stack2(y, 32, 4, stride1=2, name='stack2') y = resnet.stack2(y, 64, 6, stride1=2, name='stack3') y = resnet.stack2(y, 128, 3, stride1=1, name='stack4') #y = tf.keras.layers.BatchNormalization()(y) #y = tf.keras.layers.ReLU()(y) #y = tf.keras.layers.Conv2D(, 3, ) return tf.keras.Model(x, y)
def stack_fn(x): x = resnet.stack2(x, 64, 3, name='conv2') x = resnet.stack2(x, 128, 8, name='conv3') x = resnet.stack2(x, 256, 36, name='conv4') return resnet.stack2(x, 512, 3, stride1=1, name='conv5')