Skip to content

Instantly share code, notes, and snippets.

@CVxTz
Created April 24, 2018 08:04
Show Gist options
  • Select an option

  • Save CVxTz/b2062891205ab6453b6ff69b495cc5e9 to your computer and use it in GitHub Desktop.

Select an option

Save CVxTz/b2062891205ab6453b6ff69b495cc5e9 to your computer and use it in GitHub Desktop.
def get_model_mel():
nclass = len(list_labels)
inp = Input(shape=(157, 320, 1))
incep_res = InceptionResNetV2(input_shape=(157, 320, 1), weights=None, include_top=False)
x = incep_res(inp)
x = GlobalMaxPool2D()(x)
x = Dropout(rate=0.1)(x)
x = Dense(128, activation=activations.relu)(x)
x = Dense(nclass, activation=activations.softmax)(x)
model = models.Model(inputs=inp, outputs=x)
opt = optimizers.Adam()
model.compile(optimizer=opt, loss=losses.sparse_categorical_crossentropy, metrics=['acc'])
model.summary()
return model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment