Learn R Programming

largeVis (version 0.2.1.1)

manifoldMap: Visualize an embedding by plotting with images

Description

Makes a plot of n images sampled from images, positions at coordinates given by x.

Usage

manifoldMap(x, n = nrow(x), images, scale = 1, ...)

Arguments

x

A largeVis object or [N,D] matrix of coordinates.

n

The number of images to sample.

images

The images. A 3-D or 4-D array.

scale

Proportion to scale the images to.

...

Addiitional parameters passed to plot.

Details

The images can be passed in either as a list or a 3- or 4-dimensional array. The first dimension is n.

If the objects in the list are matrix objects, or the array is 3-dimensional, the images will be treated as greyscale. If there is an additional dimension, it must have a length of 3 and be RGB color layers.

References

Andrej Karpapthy. t-SNE Visualization of CNN Codes.

See Also

ggManifoldMap

Examples

Run this code
# NOT RUN {
load("mnist.Rda")
load("mnistcoordinates.Rda")

flip <- function(x) apply(x,2,rev)
rotate <- function(x) t(flip(x))

mnistimages <- apply(mnist$images,
   MARGIN=1,
   FUN = function(x) as.array(rotate(flip(x))))
mnistimages <- t(mnistimages)
dim(mnistimages) <- c(42000, 28, 28)

manifoldMap(coords,
   1000,
   scale = 0.07,
   mnistimages)
# }

Run the code above in your browser using DataLab