fit_with_generator: Fit a Model using Generators

Description Usage Arguments Details Value See Also

Description

this function is used to fit or train a DLmodel by using generator functions for training and validation data.

Usage

1
2
3
4
5
fit_with_generator(.model, generator = NULL, steps_per_epoch = NULL,
  train_config = NULL, epochs = 10, starting_epoch = 1,
  validation_data = NULL, validation_steps = NULL,
  validation_config = NULL, keep_best = TRUE, verbose = TRUE,
  metrics_viewer = FALSE, reset_optimizer = FALSE, ...)

Arguments

.model

(DLmodel) The model to train

generator

(function) The generator function for training data, built by create_generator_from_config, Default: NULL

steps_per_epoch

(integer) Number of steps per training epoch, Default: NULL

train_config

(list) The training configuration, the output of create_generator_from_config when inputs are training files, Default: NULL

epochs

(numeric) Maximum number of epochs to train, Default: 10

starting_epoch

(numeric) strating epoch, useful when we want to resume a previous fit, Default: 1

validation_data

(function or matrix) Data for validation. It can be a generator function, built by create_generator_from_config, Default: NULL

validation_steps

(integer) Number of steps of validation per epoch, Default: NULL

validation_config

(list) The testing configuration, the output of create_generator_from_config when inputs are validation files, Default: NULL

keep_best

(logical) Should the training always store the best model up-to-date?, Default: TRUE

verbose

(logical) Provide additional information on training, Default: TRUE

metrics_viewer

(logical) Visualize training loss interactively while fitting?, Default: FALSE

reset_optimizer

(logical) Reset optimizer state after each subepoch?, Default: FALSE

...

extra arguments passed to other functions.

Details

generator, steps_per_epoch, validation_data and validation_steps are completely and automatically determined if one uses the train_config and validation_config parameters, both being the outputs of create_generator_from_config.

Additionally, we can pass this function two arguments: path and prefix, the best model will be stored in the corresponding path with the given prefix (usually something indicative or with a timestamp).

Value

The trained DLmodel.

See Also

callback_lambda


neuroimaginador/dl4ni documentation built on May 3, 2019, 5:47 p.m.