evalKerasMnist_0: evalKerasMnist_0

View source: R/funKerasMnist_Deprecated.R

evalKerasMnist_0R Documentation

evalKerasMnist_0

Description

Hyperparameter Tuning: Keras MNIST Classification Test Function.

Usage

evalKerasMnist_0(x, kerasConf = getKerasConf(), data = getMnistData())

Arguments

x

matrix of hyperparameter values to evaluate with the function. Rows for points and columns for dimension.

kerasConf

List of additional parameters passed to keras as described in getKerasConf. Default: kerasConf = getKerasConf().

data

mnist data set. Default: getMnistData.

Details

Trains a simple deep NN on the MNIST dataset. Standard Code from https://tensorflow.rstudio.com/ Modified by T. Bartz-Beielstein (tbb@bartzundbartz.de)

Value

list with function values (training, validation, and test loss/accuracy, and keras model information)

See Also

getKerasConf

funKerasMnist

fit

Examples


### These examples require an activated Python environment as described in
### Bartz-Beielstein, T., Rehbach, F., Sen, A., and Zaefferer, M.:
### Surrogate Model Based Hyperparameter Tuning for Deep Learning with SPOT,
### June 2021. http://arxiv.org/abs/2105.14625.
PYTHON_RETICULATE <- FALSE
if(PYTHON_RETICULATE){

library("SPOTMisc")
kerasConf <- getKerasConf()
kerasConf$verbose <- 1
lower <- c(1e-6, 1e-6, 16,0.6, 1e-9, 10, 6,0.4,0.99,1,1e-8)
upper <- c(0.5, 0.5, 512, 1.5, 1e-2, 50, 10,0.999,0.999,10,6e-8)
types <- c("numeric",  "numeric",  "integer",  "numeric",  "numeric",
           "integer",  "integer",  "numeric",  "numeric",  "integer",
           "numeric")

x <- matrix(lower, 1,)
res <- evalKerasMnist(x, kerasConf)
str(res)
### The number of units for all layers can be listed as follows:
res$modelConf$config$layers[,2]$units
}


SPOTMisc documentation built on Sept. 5, 2022, 5:06 p.m.