2
0
Fork 0
CVE/build_install.R

44 lines
1.1 KiB
R

## Installing CVE (C implementation)
(setwd('~/Projects/CVE/CVE_C'))
# equiv to Rcpp::compileAttributes().
library(devtools)
pkgbuild::compile_dll()
document() # See bug: https://github.com/stan-dev/rstantools/issues/52
pkgbuild::clean_dll()
(path <- build(vignettes = FALSE))
install.packages(path, repos = NULL, type = "source")
library(CVE)
## Installing CVEpureR
(setwd('~/Projects/CVE/CVE_R'))
library(devtools)
document() # See bug: https://github.com/stan-dev/rstantools/issues/52
(path <- build(vignettes = FALSE))
install.packages(path, repos = NULL, type = "source")
library(CVEpureR)
ds <- dataset("M1")
gc()
path <- '~/Projects/CVE/tmp/R.prof'
Rprof(path, append = F, line.profiling = T)
cve.res <- cve.call(ds$X, ds$Y, k = ncol(ds$B)) # , method = "linesearch"
Rprof(NULL)
(prof <- summaryRprof(path)) # , lines = "both"))
cve.res[[ncol(ds$B)]]$loss
X <- ds$X
Y <- ds$Y
k <- ncol(ds$B)
system.time(
cve.res <- cve(Y ~ X, k = k)
)
system.time(
cve.res <- cve(Y ~ X, k = k, method = "sgd", tau = 0.01, batch.size = 32L)
)
system.time(
cve.res <- cve(Y ~ X, k = k, method = "linesearch")
)