## if keras package has not been installed, install it.                         
if(!require(keras)) {install.packages("keras"); library(keras)}
#[1]
model0 <- keras_model_sequential()
model0 <- layer_dense(model0, units=4, input_shape=3)
model0 <- layer_activation_relu(model0)
model0 <- layer_dense(model0, units=1)
model0 <- layer_activation_relu(model0)
#[2]
"a" %>% toupper %>% paste(tolower("B"),"c",sep="") %>% sub("bc","ny",x=.)
sub("bc","ny", paste(toupper("A"),tolower("B"),"c",sep=""))
#[3]
model0 <- keras_model_sequential()
model0 %>% layer_dense(units=4, input_shape=3) %>% layer_activation_relu() %>%
  layer_dense(units=1) %>% layer_activation_relu()
#[4]
input_dim <- 3
n_sample <- 5
data0 <- matrix(runif(15),nrow=n_sample, ncol=input_dim)
pred0 <- predict(model0, data0)
pred0