Skip to content

Add flag skip_epoch_completed to Engine.terminate_epoch() #3312

@bonassifabio

Description

@bonassifabio

🚀 Feature

It is proposed to add a flag skip_epoch_completed (which defaults to False) to the method Engine.terminate_epoch() to terminate the current epoch without firing Events.EPOCH_COMPLETED.

Motivation

Suppressing the firing of Events.EPOCH_COMPLETED might be desirable for example to avoid checkpointing, early stopping, validation, and calling the scheduler step at the end of a terminated epoch.

What's happening now

Right now, Events.EPOCH_COMPLETED is always fired after Events. TERMINATE_SINGLE_EPOCH.

What would happen after this change

By default, the behavior would be the same, leaving the user the possibility to prevent Events.EPOCH_COMPLETED from being fired.

Context

See issue #3308 and PR #3309

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions