Created
October 1, 2018 19:09
-
-
Save CVxTz/b32d572a58754ed4f7a3f19cdf7b619b 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_cnn(): | |
| nclass = 5 | |
| seq_input = Input(shape=(None, WINDOW_SIZE*30, 1)) | |
| base_model = get_base_model() | |
| # for layer in base_model.layers: | |
| # layer.trainable = False | |
| encoded_sequence = TimeDistributed(base_model)(seq_input) | |
| encoded_sequence = SpatialDropout1D(rate=0.01)(Convolution1D(128, | |
| kernel_size=3, | |
| activation="relu", | |
| padding="same")(encoded_sequence)) | |
| encoded_sequence = Dropout(rate=0.05)(Convolution1D(128, | |
| kernel_size=3, | |
| activation="relu", | |
| padding="same")(encoded_sequence)) | |
| #out = TimeDistributed(Dense(nclass, activation="softmax"))(encoded_sequence) | |
| out = Convolution1D(nclass, kernel_size=3, activation="softmax", padding="same")(encoded_sequence) | |
| model = models.Model(seq_input, out) | |
| model.compile(optimizers.Adam(0.001), losses.sparse_categorical_crossentropy, metrics=['acc']) | |
| model.summary() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment