Skip to content

Instantly share code, notes, and snippets.

@monogenea

monogenea/9-audioClass.R

Last active Apr 6, 2020
Embed
What would you like to do?
# Build model
model <- keras_model_sequential() %>%
layer_conv_2d(input_shape = dim(train$X)[2:4],
filters = 16, kernel_size = c(3, 3),
activation = "relu") %>%
layer_max_pooling_2d(pool_size = c(2, 2)) %>%
layer_dropout(rate = .2) %>%
layer_conv_2d(filters = 32, kernel_size = c(3, 3),
activation = "relu") %>%
layer_max_pooling_2d(pool_size = c(2, 2)) %>%
layer_dropout(rate = .2) %>%
layer_conv_2d(filters = 64, kernel_size = c(3, 3),
activation = "relu") %>%
layer_max_pooling_2d(pool_size = c(2, 2)) %>%
layer_dropout(rate = .2) %>%
layer_conv_2d(filters = 128, kernel_size = c(3, 3),
activation = "relu") %>%
layer_max_pooling_2d(pool_size = c(28, 2)) %>%
layer_dropout(rate = .2) %>%
layer_flatten() %>%
layer_dense(units = 128, activation = "relu") %>%
layer_dropout(rate = .5) %>%
layer_dense(units = ncol(train$Y), activation = "softmax")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment