% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generator_folder_collect.R
\name{generator_fasta_label_folder_wrapper}
\alias{generator_fasta_label_folder_wrapper}
\title{Generator wrapper}
\usage{
generator_fasta_label_folder_wrapper(
val,
batch_size = NULL,
path = NULL,
voc_len = NULL,
maxlen = NULL,
gen_list = NULL,
set_learning = NULL
)
}
\arguments{
\item{val}{Train or validation generator.}
\item{batch_size}{Number of samples in one batch.}
\item{path}{Path to input files.}
\item{voc_len}{Length of vocabulary.}
\item{maxlen}{Length of predictor sequence.}
\item{gen_list}{List of generator functions.}
\item{set_learning}{When you want to assign one label to set of samples. Only implemented for \code{train_type = "label_folder"}.
Input is a list with the following parameters
\itemize{
\item \code{samples_per_target}: how many samples to use for one target.
\item \code{maxlen}: length of one sample.
\item \code{reshape_mode}: \verb{"time_dist", "multi_input"} or \code{"concat"}.
\itemize{
\item
If \code{reshape_mode} is \code{"multi_input"}, generator will produce \code{samples_per_target} separate inputs, each of length \code{maxlen} (model should have
\code{samples_per_target} input layers).
\item If reshape_mode is \code{"time_dist"}, generator will produce a 4D input array. The dimensions correspond to
\verb{(batch_size, samples_per_target, maxlen, length(vocabulary))}.
\item If \code{reshape_mode} is \code{"concat"}, generator will concatenate \code{samples_per_target} sequences
of length \code{maxlen} to one long sequence.
}
\item If \code{reshape_mode} is \code{"concat"}, there is an additional \code{buffer_len}
argument. If \code{buffer_len} is an integer, the subsequences are interspaced with \code{buffer_len} rows. The input length is
(\code{maxlen} \eqn{*} \code{samples_per_target}) + \code{buffer_len} \eqn{*} (\code{samples_per_target} - 1).
}}
}
\value{
A generator function.
}
\description{
Combines generators created by \code{\link{generator_initialize}} into a single generator.
}
\examples{
\dontshow{if (reticulate::py_module_available("tensorflow")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
# 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]]
\dontshow{\}) # examplesIf}
}