View source: R/generator_folder_collect.R
generator_fasta_label_folder_wrapper | R Documentation |
Combines generators created by generator_initialize
into a single generator.
generator_fasta_label_folder_wrapper(
val,
batch_size = NULL,
path = NULL,
voc_len = NULL,
maxlen = NULL,
gen_list = NULL,
set_learning = NULL
)
val |
Train or validation generator. |
batch_size |
Number of samples in one batch. |
path |
Path to input files. |
voc_len |
Length of vocabulary. |
maxlen |
Length of predictor sequence. |
gen_list |
List of generator functions. |
set_learning |
When you want to assign one label to set of samples. Only implemented for
|
A generator function.
# create two folders with dummy fasta files
path_input_1 <- tempfile()
dir.create(path_input_1)
create_dummy_data(file_path = path_input_1, num_files = 2, seq_length = 5,
num_seq = 2, vocabulary = c("a", "c", "g", "t"))
path_input_2 <- tempfile()
dir.create(path_input_2)
create_dummy_data(file_path = path_input_2, num_files = 3, seq_length = 7,
num_seq = 5, vocabulary = c("a", "c", "g", "t"))
maxlen <- 5
p <- c(path_input_1, path_input_1)
gen_list <- generator_initialize(directories = p,
batch_size = 4, maxlen = maxlen)
gen <- generator_fasta_label_folder_wrapper(val = FALSE, batch_size = 8,
path = p, voc_len = 4,
maxlen = maxlen,
gen_list = gen_list)
z <- gen()
dim(z[[1]])
z[[2]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.