I want to make my own array of (N x N) matrices that matches the keras-compatible format that is loaded with dataset_mnist(). As
mnist <- dataset_mnist()
x_train <- mnist$train$x
str (x_train)
yields
int [1:60000, 1:28, 1:28] 0 0 0 0 0 0 0 0 0 0 ...
I want to make my own data in this format. Let's say I have 2000 different 100x100 matrices of integers: mat1, mat2, mat3, mat4... mat2000. How can I combine them to produce an object with the structure:
int [1:2000, 1:100, 1:100] ...
that I can then use as input data for keras models?
I've tried:
as.vector (c(mat1, mat2))
as.array (c(mat1, mat2))
rbind (mat1, mat2)
But it does not produce the correctly structured data. Thank you for your help!