Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #set training data:
  2. x_train <- as.matrix(Daten[1:5300,3:ncol(Daten)])
  3.  
  4.  
  5. #set model:
  6. model <- keras_model_sequential()
  7. model %>%
  8. layer_dense(units = 5, activation = "tanh",
  9. input_shape = ncol(x_train), name = "bottleneck")%>%
  10. layer_dense(units = ncol(x_train))
  11.  
  12. #compile model:
  13. model %>% compile(loss= "mean_squared_error", optimizer = "adam",
  14. metrics = c("accuracy"))
  15.  
  16. #train model:
  17. model %>% fit(x=x_train, y= x_train, epochs = 50, batch_size=32, verbose
  18. = 1)
  19.  
  20.  
  21. #show the weights of the model:
  22. weights <- get_weights(model)
  23.  
  24. print(weights)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement