
## Keras Settings
x <- c("reticulate","keras","tensorflow")
for(i in x){
  if(!is.element(i,rownames(installed.packages()))){tryCatch({install.packages(i)}
             ,error=function(e){stop(message("Error on install R Package",i))})}}
if(tryCatch({!reticulate::py_config()$available},error=function(e){TRUE})){
  warning("Python environment unable to find")
  tryCatch({reticulate::install_miniconda()}
           ,error=function(e){message("Error on install miniconda")})}
if(tryCatch({!tensorflow::tf_config()$available},error=function(e){TRUE})){
  tryCatch({tensorflow::install_tensorflow()}
           ,error=function(e){message("Error on install tenforflow at Python")})}
if(tryCatch({!keras::is_keras_available()},error=function(e){TRUE})){
  tryCatch({keras::install_keras()}
           ,error=function(e){message("Error on install keras in Python")})}
library(keras)
print(as.array(k_exp(1)))
