Skip to content
Snippets Groups Projects
Commit 4061fd81 authored by Vivien Leclercq's avatar Vivien Leclercq
Browse files

Update simple_deep_learning.R

parent 7fe518d9
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@ keras::install_keras(tensorflow = "cpu")
library(keras)
parole_train <- read.csv("/cloud/project/parole_train.txt", sep="")
parole_train <- parole_train
# Generation of 2/3 observations
......@@ -35,7 +36,7 @@ model %>% layer_dense(units=128, activation = "relu", input_shape = c(256)) %>%
model %>% compile(
loss = 'categorical_crossentropy',
optimizer = optimizer_rmsprop(),
optimizer = "adam",
metrics = c('accuracy')
)
......@@ -43,9 +44,10 @@ summary(model)
history <- model %>% fit(
x_train, y_train,
epochs = 30, batch_size = 256, verbose=2
epochs = 50, batch_size = 256, verbose=2
)
pred.parole_train.deep <- as.array(model %>% predict(scale(data.matrix(X.test[, 1:256]))) %>% k_argmax())
#Matrix of confusion
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment