randEmb | R Documentation |
Random embedding of a low dimensional subspace on the centered hypercube, based on a matrix and convex projection Random embedding mapping
randEmb(y, A)
y |
matrix of low dimensional coordinates, one point per row |
A |
random embedding matrix |
Matrix corresponding to convex projection onto [-1, 1]^D of A * y
Z. Wang, F. Hutter, M. Zoghi, D. Matheson, N. de Freitas (2016), Bayesian Optimization in a Billion Dimensions via Random Embeddings, JAIR.
## Small dimensional examples for illustration
d <- 1; D <- 2
set.seed(42)
ntest <- 1000
size <- 1.5 # box size of Y
Y <- size * (2 * matrix(runif(ntest * d), ntest, d) - 1)
A <- matrix(rnorm(D *d), D, d)
X <- randEmb(Y, A)
plot(t(A %*% t(Y)), type = 'l', ylim = c(-1,1), xlim = c(-1, 1))
points(X, col = 'red', pch = 20)
library(rgl)
d <- 2; D <- 3
Y <- size * (2 * matrix(runif(ntest * d), ntest, d) - 1)
A <- matrix(rnorm(D *d), D, d)
X <- randEmb(Y, A)
plot3d(t(A %*% t(Y)))
points3d(X, col = 'red', pch = ".")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.