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

faster matrix multiplication for leaf prediction #19

Closed
bcjaeger opened this issue Oct 14, 2023 · 1 comment
Closed

faster matrix multiplication for leaf prediction #19

bcjaeger opened this issue Oct 14, 2023 · 1 comment

Comments

@bcjaeger
Copy link
Collaborator

Taking sub-matrix views will likely be less fast than iterating over the relevant columns/rows.

Consider implementing this function for data class:


arma::vec submat_mult_lincomb(arma::mat& x,
                              arma::uvec& x_rows,
                              arma::uvec& x_cols,
                              arma::vec& beta){

 arma::vec out (x_rows.size());
 arma::uword i = 0;
 arma::uword j = 0;

 for(auto row : x_rows){
  j=0;
  for(auto col : x_cols){
   out[i] += x.at(row, col) * beta[j];
   j++;
  }
  i++;
 }

 return(out);

}

@bcjaeger bcjaeger changed the title faster matrix multiplication in during leaf prediction faster matrix multiplication for leaf prediction Oct 14, 2023
@bcjaeger
Copy link
Collaborator Author

Fixed with #20

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

No branches or pull requests

1 participant