| matrix_to_array_c {aifeducation} | R Documentation |
Reshape matrix to array
Description
Function written in C++ for reshaping a matrix containing sequential data into an array for use with keras.
Usage
matrix_to_array_c(matrix, times, features)
Arguments
matrix |
|
times |
|
features |
|
Value
Returns an array. The first dimension corresponds to the cases, the second to the times, and the third to the features.
See Also
Other Auxiliary Functions:
array_to_matrix(),
calc_standard_classification_measures(),
check_embedding_models(),
clean_pytorch_log_transformers(),
create_iota2_mean_object(),
create_synthetic_units(),
generate_id(),
get_coder_metrics(),
get_folds(),
get_n_chunks(),
get_stratified_train_test_split(),
get_synthetic_cases(),
get_train_test_split(),
is.null_or_na(),
split_labeled_unlabeled(),
summarize_tracked_sustainability(),
to_categorical_c()
Examples
#matrix has shape (batch,times*features)
matrix<-matrix(data=c(1,1,1,2,2,2,
2,2,2,3,3,3,
1,1,1,1,1,1),
nrow=3,
byrow=TRUE)
matrix
#Transform matrix to a array
#array has shape (batch,times*features)
matrix_to_array_c(matrix=matrix,times=2,features=3)