R Under development (unstable) (2018-03-13 r74399) -- "Unsuffered Consequences" Copyright (C) 2018 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > pkgname <- "RcppShark" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('RcppShark') RcppShark v3.1.1 loaded. > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("DeepNetworkTrain") > ### * DeepNetworkTrain > > flush(stderr()); flush(stdout()) > > ### Name: DeepNetworkTrain > ### Title: Training a simple deep network. > ### Aliases: DeepNetworkTrain > > ### ** Examples > > x = as.matrix(iris[,1:4]) > y = as.vector(as.numeric(iris[,5])) > y = replace(y, y == 2, 0) > y = replace(y, y == 3, 0) > model = DeepNetworkTrain (x, y, nHidden1 = 32, nHidden2 = 32) /data/gannet/ripley/R/test-clang/BH/include/boost/container/detail/copy_move_algo.hpp:580:16: runtime error: null pointer passed as argument 1, which is declared to never be null /usr/include/string.h:63:62: note: nonnull attribute specified here SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /data/gannet/ripley/R/test-clang/BH/include/boost/container/detail/copy_move_algo.hpp:580:16 in > results = DeepNetworkPredict (x, model) > networkPrediction = apply (results$prediction, 1, which.max) - 1 > errors = sum(abs(y - networkPrediction))/length(y) > cat("Network produced ", errors, "errors.\n") Network produced 0 errors. > > > > cleanEx() > nameEx("SharkBSGDPredict") > ### * SharkBSGDPredict > > flush(stderr()); flush(stdout()) > > ### Name: SharkBSGDPredict > ### Title: Budgeted SGD Predict. > ### Aliases: SharkBSGDPredict > > ### ** Examples > > x = as.matrix(iris[,1:4]) > y = as.vector(as.numeric(iris[,5])) > y = replace(y, y == 2, 0) > y = replace(y, y == 3, 0) > model = SharkBSGDTrain (x, y, C = 0.0001, + budget = 5, gamma = 1, epochs = 1, strategy = "Merge") > results = SharkBSGDPredict (x, model) > cat ("BSGD training error is ", sum(abs(y - results$predictions))/length(y), "\n") BSGD training error is 0 > > > > ### *