Hi.
I am using tfrun on Keras Hyperparameter Tuning.
For example,following code is to test dense_units1=c(64,128,256) successfully
But how to test the model without dense_units1? dense_units1=c(0,64,128,256) will not work.
tfruns::tuning_run('number_recognition_002_model.R',
#sample=0.1, # use 10%
flags = list(
dense_units1=c(64,128,256),
dense_units2=c(64,128,256),
dropout1=c(0.1,0.2),
dropout2=c(0.1)
#batch_size=c(32,64)
)
)
number_recognition_002_model.R:
FLAGS <- flags(
flag_numeric("dense_units1", 64),
flag_numeric("dense_units2", 64),
flag_numeric("dropout1", 0.4),
flag_numeric("dropout2", 0.3)
)
model <- keras_model_sequential()
model %>%
layer_dense(units = FLAGS$dense_units1, activation = "relu", input_shape = c(784)) %>%
layer_dropout(rate = FLAGS$dropout1) %>%
layer_dense(units = FLAGS$dense_units2, activation = "relu") %>%
layer_dropout(rate = FLAGS$dropout2) %>%
layer_dense(units = 10, activation = "softmax")
summary(model)
Thank you