combine_generators: Make a DataGenerator that merges multiple DataGenerators into...

View source: R/DataGenerators.R

combine_generatorsR Documentation

Make a DataGenerator that merges multiple DataGenerators into one.

Description

Creates a Python Class that internally iterates over the data. Generators can e.g. come from make_generator_from_dataframe or from keras::flow_images_from_dataframe. Need to have equal batch size, and optionally equal seeds if shuffling is used.

Returns batches of the following form: list( list(X1_batch, X2_batch), Y_batch ) or where Y_batch is Y1_batch, Y2_batch if both gen._y are TRUE, else just e.g. Y1_batch (default).

Usage

combine_generators(gen1, gen2, gen1_y = TRUE, gen2_y = FALSE)

Arguments

gen1

DataGenerator
First Data Generator to loop over.

gen2

DataGenerator
Second Data Generator to loop over.

gen1_y

logical
Should target variable of gen1 be returned? Default TRUE.

gen2_y

logical
Should target variable of gen2 be returned? Default FALSE.


mlr-org/mlr3keras documentation built on April 12, 2022, 11:35 a.m.