matrix.convex_relu {adelie} | R Documentation |
Creates a feature matrix for the convex relu problem.
Description
Creates a feature matrix for the convex relu problem.
Usage
matrix.convex_relu(mat, mask, gated = FALSE, n_threads = 1)
Arguments
mat |
Base feature matrix. It is either a dense or sparse matrix. |
mask |
Boolean mask matrix. |
gated |
Flag to indicate whether to use the convex gated relu feature matrix. |
n_threads |
Number of threads. |
Value
Convex relu feature matrix. The object is an S4 class with methods for efficient computation in C++ by adelie.
Author(s)
Trevor Hastie and James Yang
Maintainer: Trevor Hastie hastie@stanford.edu
Examples
n <- 100
p <- 20
m <- 10
Z_dense <- matrix(rnorm(n * p), n, p)
mask <- matrix(rbinom(n * m, 1, 0.5), n, m)
out <- matrix.convex_relu(Z_dense, mask)
Z_sparse <- as(Z_dense, "dgCMatrix")
out <- matrix.convex_relu(Z_sparse, mask)
[Package adelie version 1.0.8 Index]