kerasCompileResult: Generate result from keras run

View source: R/kerasHelper.R

kerasCompileResultR Documentation

Generate result from keras run

Description

Compile a matrix with training, validation, and test results

Usage

kerasCompileResult(y, kerasConf)

Arguments

y

(1x6)-dim matrix with the following entries: trainingLoss, negTrainingAccuracy, validationLoss, negValidationAccuracy, testLoss,and negTestAccuracy.

kerasConf

keras configuration generated with getKerasConf

Details

All values should be minimized: accuracies will be negative. The (1x7)-dim result matrix has the following entries

returnValue:

Metric used for optimization. Default: "validationLoss".

trainingLoss:

training loss.

negTrainingAccuracy:

negative training accuracy.

validationLoss:

validation loss.

negValidationAccuracy:

negative validation accuracy.

testLoss:

test loss.

negTestAccuracy:

negative test accuracy.

Value

result matrix

See Also

evalKerasMnist

funKerasMnist

Examples

x <- 1
testLoss <-  x
negTestAccuracy <- 1-x
validationLoss <- x/2
negValidationAccuracy <- 1-x/2
trainingLoss <- x/3
negTrainingAccuracy <- 1-x/3
y <- matrix(c(trainingLoss, negTrainingAccuracy,
validationLoss, negValidationAccuracy,
testLoss, negTestAccuracy), 1,6)
kerasConf <- list()
kerasConf$returnValue <-   "testLoss"
sum(kerasCompileResult(y, kerasConf)) == 4
kerasConf$returnValue <-  "negTestAccuracy"
sum(kerasCompileResult(y, kerasConf)) == 3
kerasConf$returnValue <-   "validationLoss"
sum(kerasCompileResult(y, kerasConf))*2 == 7
kerasConf$returnValue <-   "negValidationAccuracy"
sum(kerasCompileResult(y, kerasConf))*2 == 7
kerasConf$returnValue <-     "trainingLoss"
sum(kerasCompileResult(y, kerasConf))*3 == 10
kerasConf$returnValue <-   "negTrainingAccuracy"
sum(kerasCompileResult(y, kerasConf))*3 == 11


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