August 2017
Intermediate to advanced
288 pages
8h 6m
English
This recipe covers the steps for the evaluation of weights obtained from an RBM:
uw = t(weights[[length(weights)]]) # Extract the most recent weight matrix numXpatches = 20 # Number of images in X-axis (user input) numYpatches=20 # Number of images in Y-axis (user input) pixels <- list() op <- par(no.readonly = TRUE) par(mfrow = c(numXpatches,numYpatches), mar = c(0.2, 0.2, 0.2, 0.2), oma = c(3, 3, 3, 3)) for (i in 1:(numXpatches*numYpatches)) { denom <- sqrt(sum(uw[i, ]^2)) pixels[[i]] <- matrix(uw[i, ]/denom, nrow = numYpatches, ncol = numXpatches) image(pixels[[i]], axes = F, col = gray((0:32)/32)) } par(op)
Read now
Unlock full access