# NOT RUN {
# }
# NOT RUN {
library(keras)
library(dplyr)
library(kerastuneR)
kerastuneR::install_kerastuner()
cifar <- dataset_cifar10()
hypermodel = kerastuneR::HyperResNet(input_shape = list(32L, 32L, 3L), classes = 10L)
hypermodel2 = kerastuneR::HyperXception(input_shape = list(32L, 32L, 3L), classes = 10L)
tuner = kerastuneR::Hyperband(
hypermodel = hypermodel,
objective = 'accuracy',
loss = 'sparse_categorical_crossentropy',
max_epochs = 1,
directory = 'my_dir',
project_name='helloworld')
train_data = cifar$train$x[1:30,1:32,1:32,1:3]
test_data = cifar$train$y[1:30,1] %>% as.matrix()
tuner %>% fit_tuner(train_data,test_data, epochs = 1)
# }
Run the code above in your browser using DataLab