We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Optimization in the sgccak function
Original:
for (q in seq_len(J)) { if (mode(scheme) == "function") { dgx <- dg(cov2(Y, Y[, q], bias = bias)) CbyCovq <- C[q, ] * dgx } else { if (scheme == "horst") { CbyCovq <- C[q, ] } else if (scheme == "factorial") { CbyCovq <- C[q, ] * 2 * cov2(Y, Y[, q], bias = bias) } else if (scheme == "centroid") { CbyCovq <- C[q, ] * sign(cov2(Y, Y[, q], bias = bias)) } } Z[, q] <- rowSums(mapply("*", CbyCovq, as.data.frame(Y))) a[[q]] <- drop(crossprod(A[[q]], Z[, q, drop = FALSE])) a[[q]] <- soft.threshold(a[[q]], const[q]) a[[q]] <- as.vector(a[[q]]) / norm2(a[[q]]) Y[, q] <- drop(A[[q]] %*% a[[q]]) }
Proposed:
if (mode(scheme) == "function") { dgx <- dg(cov2(Y, Y, bias = bias)) CbyCovq <- C * dgx } else { if (scheme == "horst") { CbyCovq <- C } else if (scheme == "factorial") { CbyCovq <- C * 2 * cov2(Y, Y, bias = bias) } else if (scheme == "centroid") { CbyCovq <- C * sign(cov2(Y, Y, bias = bias)) } } Z <- t(tcrossprod(CbyCovq, Y)) for (q in seq_len(J)) { a[[q]] <- drop(crossprod(A[[q]], Z[, q, drop = FALSE])) a[[q]] <- soft.threshold(a[[q]], const[q]) a[[q]] <- as.vector(a[[q]]) / norm2(a[[q]]) Y[, q] <- drop(A[[q]] %*% a[[q]]) }
see related issues #16, #19, and the comment
The text was updated successfully, but these errors were encountered:
Merge pull request #25 from rgcca-factory/feature/proj_l1_l2_version_2
a0e39d5
Feature/proj l1 l2 version 2
llrs
No branches or pull requests
Optimization in the sgccak function
Original:
Proposed:
see related issues #16, #19, and the comment
The text was updated successfully, but these errors were encountered: