Skip to content

max_iters as optional arg in Engine run #1300

Closed
@vfdev-5

Description

@vfdev-5

🚀 Feature

Idea is to cover the following usage:

trainer.run(data, max_iters=1234)
# here we still have epoch length as len(data) if defined

which can be roughly done as

max_iters = 1234
trainer.run(data, epoch_length=max_iters)
# here we run 1 epoch of size max_iters

or as something like

max_iters = 1234
epoch_length = ...
max_epochs = max_iters // epoch_length + 1

@trainer.on(Events.ITERATION_COMPLETED(once=max_iters))
def stop():
    trainer.terminate()

trainer.run(data, max_epochs=max_epochs)

Argument max_iters is mutually exclusive with max_epochs.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions