randEmb: Random embedding of a low dimensional subspace on the...

View source: R/mappings.R

randEmbR Documentation

Random embedding of a low dimensional subspace on the centered hypercube, based on a matrix and convex projection Random embedding mapping

Description

Random embedding of a low dimensional subspace on the centered hypercube, based on a matrix and convex projection Random embedding mapping

Usage

randEmb(y, A)

Arguments

y

matrix of low dimensional coordinates, one point per row

A

random embedding matrix

Value

Matrix corresponding to convex projection onto [-1, 1]^D of A * y

References

Z. Wang, F. Hutter, M. Zoghi, D. Matheson, N. de Freitas (2016), Bayesian Optimization in a Billion Dimensions via Random Embeddings, JAIR.

Examples

## 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 = ".")

mbinois/RRembo documentation built on Sept. 16, 2023, 10:15 p.m.