Base network to be shared (eq. to feature extraction).
(input_shape)
| 158 | |
| 159 | |
| 160 | def create_base_network(input_shape): |
| 161 | '''Base network to be shared (eq. to feature extraction). |
| 162 | ''' |
| 163 | input = Input(shape=input_shape) |
| 164 | x = Flatten()(input) |
| 165 | x = Dense(128, act=tf.nn.relu)(x) |
| 166 | x = Dropout(0.9)(x) |
| 167 | x = Dense(128, act=tf.nn.relu)(x) |
| 168 | x = Dropout(0.9)(x) |
| 169 | x = Dense(128, act=tf.nn.relu)(x) |
| 170 | return Model(input, x) |
| 171 | |
| 172 | |
| 173 | def get_siamese_network(input_shape): |