Created
July 14, 2018 21:05
-
-
Save CVxTz/000ca002ff26eca0f7f83168d1eaa282 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 = 5 | |
| inp = Input(shape=(187, 1)) | |
| img_1 = Convolution1D(16, kernel_size=5, activation=activations.relu, padding="valid")(inp) | |
| img_1 = Convolution1D(16, kernel_size=5, activation=activations.relu, padding="valid")(img_1) | |
| img_1 = MaxPool1D(pool_size=2)(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=2)(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=2)(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, name="dense_1")(img_1) | |
| dense_1 = Dense(64, activation=activations.relu, name="dense_2")(dense_1) | |
| dense_1 = Dense(nclass, activation=activations.softmax, name="dense_3_mitbih")(dense_1) | |
| model = models.Model(inputs=inp, outputs=dense_1) | |
| opt = optimizers.Adam(0.001) | |
| 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