Skip to contents

These helpers control the caps that built-in training loops obey when running fit(), evaluate(), or predict(). The values can also be provided via the KERAS_MAX_EPOCHS or KERAS_MAX_STEPS_PER_EPOCH environment variables to quickly constrain a run without modifying source code.

Usage

config_max_epochs()

config_set_max_epochs(max_epochs)

config_max_steps_per_epoch()

config_set_max_steps_per_epoch(max_steps_per_epoch)

Arguments

max_epochs

Integer upper bound for epochs processed by built-in training loops. Use NULL to remove the cap.

max_steps_per_epoch

Integer upper bound for steps processed per epoch by built-in training loops. Use NULL to remove the cap.

Value

config_max_epochs() and config_max_steps_per_epoch() return the current integer limits (or NULL if the cap is unset). The setter variants return NULL invisibly and are called for side effects.