Skip to content

EpochOutputStore can optionally store the data to the state #1939

@vfdev-5

Description

@vfdev-5

🚀 Feature

The idea is to give an option to have the following:

eos = EpochOutputStore()

evaluator = create_supervised_evaluator(model, metrics)
eos.attach(evaluator, name="eval_data")

# Adding the name is equivalent to
# name = "eval_data"
# @evaluator.on(Events.EPOCH_COMPLETED, name)
# def store_data(engine, name):
#     setattr(engine.state, name, eos.data)

state = evaluator.run(data)
print(len(state.eval_data))

In addition, it would make sense to move it from contrib to core as well, keeping BC.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions