* using log directory ‘/data/gannet/ripley/R/packages/tests-LENGTH1/gradDescent.Rcheck’ * using R Under development (unstable) (2022-04-26 r82260) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--no-stop-on-test-error’ * checking for file ‘gradDescent/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘gradDescent’ version ‘3.0’ * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘gradDescent’ can be installed ... [4s/11s] OK * checking package directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [8s/21s] OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking contents of ‘data’ directory ... OK * checking data for non-ASCII characters ... OK * checking data for ASCII and uncompressed saves ... OK * checking examples ... ERROR Running examples in ‘gradDescent-Ex.R’ failed The error most likely occurred in: > ### Name: SARAHPlus > ### Title: Stochastic Recursive Gradient Algorithm+ (SARAH+) Method > ### Learning Function > ### Aliases: SARAHPlus > > ### ** Examples > > ################################## > ## Learning and Build Model with SARAH+ > ## load R Package data > data(gradDescentRData) > ## get z-factor data > dataSet <- gradDescentRData$CompressilbilityFactor > ## split dataset > splitedDataSet <- splitData(dataSet) > ## build model with SARAH+ > SARAHPlusmodel <- SARAHPlus(splitedDataSet$dataTrain) ----------- FAILURE REPORT -------------- --- failure: length > 1 in coercion to logical --- --- srcref --- : --- package (from environment) --- gradDescent --- call from context --- SARAHPlus(splitedDataSet$dataTrain) --- call from argument --- ((abs(colSums(gradient)/3))^2) > (gammaS * ((abs(colSums(firstGradient)/3))^2)) && iter < innerIter --- R stacktrace --- where 1: SARAHPlus(splitedDataSet$dataTrain) --- value of length: 3 type: logical --- [1] TRUE TRUE TRUE --- function from context --- function (dataTrain, alpha = 0.1, maxIter = 10, innerIter = 10, gammaS = 0.125, seed = NULL) { start_time <- Sys.time() dataTrain <- matrix(unlist(dataTrain), ncol = ncol(dataTrain), byrow = FALSE) set.seed(seed) dataTrain <- dataTrain[sample(nrow(dataTrain)), ] set.seed(NULL) theta <- getTheta(ncol(dataTrain), seed = seed) dataTrain <- cbind(1, dataTrain) inputData <- dataTrain[, 1:ncol(dataTrain) - 1] outputData <- dataTrain[, ncol(dataTrain)] temporaryTheta <- matrix(ncol = length(theta), nrow = 1) temporaryTheta2 <- matrix(ncol = length(theta), nrow = 1) temporaryThetaList <- matrix(ncol = length(theta)) gradient <- matrix(0, ncol = length(theta), nrow = 1) rowLength <- nrow(dataTrain) set.seed(seed) randRowList <- sample(1:rowLength, innerIter, replace = TRUE) set.seed(NULL) for (iteration in 1:maxIter) { temporaryTheta <- theta error <- (inputData %*% t(temporaryTheta)) - outputData for (column in 1:length(temporaryTheta)) { term <- error * inputData[, column] gradient[, column] <- sum(term)/rowLength temporaryTheta2[, column] <- temporaryTheta[, column] - (alpha * gradient[, column]) } firstGradient <- gradient temporaryThetaList <- temporaryTheta iter <- 1 while (((abs(colSums(gradient)/3))^2) > (gammaS * ((abs(colSums(firstGradient)/3))^2)) && iter < innerIter) { error2 <- (inputData[randRowList[iter], ] %*% t(temporaryTheta2)) - outputData[randRowList[iter]] error3 <- (inputData[randRowList[iter], ] %*% t(temporaryTheta)) - outputData[randRowList[iter]] temporaryTheta <- temporaryTheta2 for (column in 1:length(theta)) { term2 <- error2 * inputData[randRowList[iter], column] term3 <- error3 * inputData[randRowList[iter], column] gradient[, column] <- term2 - term3 + gradient[, column] temporaryTheta2[1, column] <- temporaryTheta2[1, column] - (alpha * gradient[, column]) } temporaryThetaList <- rbind(temporaryThetaList, temporaryTheta2) iter <- iter + 1 } theta[1, ] <- temporaryThetaList[iter, ] } result <- theta end_time <- Sys.time() print(end_time - start_time) return(result) } --- function search by body --- Function SARAHPlus in namespace gradDescent has this body. ----------- END OF FAILURE REPORT -------------- Fatal error: length > 1 in coercion to logical * checking PDF version of manual ... OK * checking for non-standard things in the check directory ... OK * checking for detritus in the temp directory ... OK * DONE Status: 1 ERROR See ‘/data/gannet/ripley/R/packages/tests-LENGTH1/gradDescent.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 1:46.75, 34.61 + 5.58