Created
February 15, 2020 18:16
-
-
Save CVxTz/532a48fbdd3fad7a47ccacab8851d27d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_model(n_class=5): | |
inp = Input(shape=(187, 1)) | |
x = Convolution1D(64, kernel_size=5, activation=activations.relu, padding="valid")( | |
inp | |
) | |
x = MaxPool1D(pool_size=4)(x) | |
x = Convolution1D(64, kernel_size=3, activation=activations.relu, padding="valid")( | |
x | |
) | |
x = MaxPool1D(pool_size=4)(x) | |
x = GlobalMaxPool1D()(x) | |
x = Dense(64, activation=activations.relu)(x) | |
x = Dense(n_class, activation=activations.softmax)(x) | |
model = models.Model(inputs=inp, outputs=x) | |
opt = optimizers.Adam(0.0001) | |
model.compile(optimizer=opt, loss=losses.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