Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translated the hh-lambda loop #32

Merged
merged 49 commits into from
Mar 5, 2024
Merged

Translated the hh-lambda loop #32

merged 49 commits into from
Mar 5, 2024

Conversation

wleoncio
Copy link
Member

@wleoncio wleoncio commented Mar 4, 2024

Summary

Lots of changes related to work towards #17.

Most relevant commits

There are a couple of issues detected during this work, but they'll be left to another issue since they are already present on main (meaning they were not introduced here). Namely:

set.seed(9356219)
fit_C <- MADMMplasso(
X, Z, y,
alpha = alpha, my_lambda = matrix(rep(0.2, dim(y)[2]), 1),
lambda_min = 0.001, max_it = 5000, e.abs = e.abs, e.rel = e.rel, maxgrid = nlambda,
nlambda = nlambda, rho = 5, tree = TT, my_print = FALSE, alph = 1, parallel = FALSE,
pal = TRUE, gg = gg1, tol = tol, cl = 6
) # FIXME: fails if (parallel = FALSE && pal = FALSE) or (parallel = TRUE)
set.seed(9356219)
fit_R <- suppressWarnings(
suppressMessages(
MADMMplasso(
X, Z, y,
alpha = alpha, my_lambda = matrix(rep(0.2, dim(y)[2]), 1),
lambda_min = 0.001, max_it = 5000, e.abs = e.abs, e.rel = e.rel, maxgrid = nlambda,
nlambda = nlambda, rho = 5, tree = TT, my_print = FALSE, alph = 1, parallel = FALSE,
pal = TRUE, gg = gg1, tol = tol, cl = 6, legacy = TRUE
)
)
) # FIXME: fails if (parallel = TRUE)

Because `admm_MADMMplasso_cpp()` is a subfunction of `hh_nlambda_loop_cpp()`.
Because it is only recreated if `pal = 1`
This reverts commit 92eda0139517ad26680072f172dcdb7f3ad16a44.
`[]` is technically possible, but has no bounds check. See <https://arma.sourceforge.net/docs.html#element_access> for more details.
This should streamline processing through `hh_nlambda_loop_cpp()`.
The only missing part now are bits related to and dependend on the translation of `count_nonzero_a()`.
Still needs to translate `count_nonzero_a()`, which is currently bring pulled from R with a performance penalty. However, this version is already useful for comparing outputs of `legacy = TRUE` and `legacy = FALSE`
@wleoncio wleoncio requested a review from Theo-qua March 4, 2024 16:03
@Theo-qua Theo-qua merged commit 9896eeb into main Mar 5, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants