Created
April 24, 2018 08:02
-
-
Save CVxTz/da5d6679a1cb5e3944bcea6b5224e4c8 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(): | |
| nclass = len(list_labels) | |
| inp = Input(shape=(input_length, 1)) | |
| img_1 = Convolution1D(16, kernel_size=9, activation=activations.relu, padding="valid")(inp) | |
| img_1 = Convolution1D(16, kernel_size=9, activation=activations.relu, padding="valid")(img_1) | |
| img_1 = MaxPool1D(pool_size=16)(img_1) | |
| img_1 = Dropout(rate=0.1)(img_1) | |
| img_1 = Convolution1D(32, kernel_size=3, activation=activations.relu, padding="valid")(img_1) | |
| img_1 = Convolution1D(32, kernel_size=3, activation=activations.relu, padding="valid")(img_1) | |
| img_1 = MaxPool1D(pool_size=4)(img_1) | |
| img_1 = Dropout(rate=0.1)(img_1) | |
| img_1 = Convolution1D(32, kernel_size=3, activation=activations.relu, padding="valid")(img_1) | |
| img_1 = Convolution1D(32, kernel_size=3, activation=activations.relu, padding="valid")(img_1) | |
| img_1 = MaxPool1D(pool_size=4)(img_1) | |
| img_1 = Dropout(rate=0.1)(img_1) | |
| img_1 = Convolution1D(256, kernel_size=3, activation=activations.relu, padding="valid")(img_1) | |
| img_1 = Convolution1D(256, kernel_size=3, activation=activations.relu, padding="valid")(img_1) | |
| img_1 = GlobalMaxPool1D()(img_1) | |
| img_1 = Dropout(rate=0.2)(img_1) | |
| dense_1 = Dense(64, activation=activations.relu)(img_1) | |
| dense_1 = Dense(1028, activation=activations.relu)(dense_1) | |
| dense_1 = Dense(nclass, activation=activations.softmax)(dense_1) | |
| model = models.Model(inputs=inp, outputs=dense_1) | |
| opt = optimizers.Adam(0.00001) | |
| 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