Created
June 30, 2017 10:09
-
-
Save ilkarman/3a2cb478a39b7a53d4a2ad2a2ca804f7 to your computer and use it in GitHub Desktop.
Generate square of feature maps for nnet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
square_stack_lst_of_matricies <- function(lst) | |
{ | |
sqr_size <- sqrt(length(lst)) | |
# Stack vertically | |
cols <- do.call(cbind, lst) | |
# Split to another dim | |
dim(cols) <- c(dim(filter_map[[1]])[[1]], | |
dim(filter_map[[1]])[[1]]*sqr_size, | |
sqr_size) | |
# Stack horizontally | |
do.call(rbind, lapply(1:dim(cols)[3], function(i) cols[, , i])) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment