Skip to content

move EpochOutputStore out of contrib keeping BC#1982

Merged
vfdev-5 merged 3 commits intopytorch:masterfrom
radekosmulski:move_eos
May 1, 2021
Merged

move EpochOutputStore out of contrib keeping BC#1982
vfdev-5 merged 3 commits intopytorch:masterfrom
radekosmulski:move_eos

Conversation

@radekosmulski
Copy link
Copy Markdown
Contributor

@radekosmulski radekosmulski commented May 1, 2021

Fixes #1939

Description: Moves EpochOutputStore out of contrib keeping BC.

Check list:

  • New tests are added (if a new feature is added)
  • New doc strings: description and/or example code are in RST format
  • Documentation is updated (if required)

@github-actions github-actions bot added module: contrib Contrib module module: handlers Core Handlers module labels May 1, 2021
@vfdev-5
Copy link
Copy Markdown
Collaborator

vfdev-5 commented May 1, 2021

@radekosmulski thanks a lot !

I think there could be something to do with docs as failing job here is real :

Could you also please put "Fixes #1939" instead of "Implements" to close the issue automatically once the PR is merged. Thanks

@vfdev-5
Copy link
Copy Markdown
Collaborator

vfdev-5 commented May 1, 2021

@radekosmulski can we improve the docstring example as well :

eos = EpochOutputStore()
trainer = create_supervised_trainer(model, optimizer, loss)
train_evaluator = create_supervised_evaluator(model, metrics)
eos.attach(train_evaluator, 'output')

@trainer.on(Events.EPOCH_COMPLETED)
def log_training_results(engine):
    train_evaluator.run(train_loader)
    output = train_evaluator.output
    # output = [(y_pred0, y0), (y_pred1, y1), ...] 
    # do something with output, e.g., plotting

It would be also very helpful to add Attributes field and describe data as list of engine outputs, optionally transformed by output_transform.
For more details on google style: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html

I also think we should fix typing hint here:

- self.data = []  # type: List[Union[int, Tuple[int, int]]]
+ self.data = []  # type: List[Any]

Copy link
Copy Markdown
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@radekosmulski thanks a lot for the PR ! LGTM!

@vfdev-5 vfdev-5 enabled auto-merge (squash) May 1, 2021 18:30
@vfdev-5 vfdev-5 merged commit 2db9bf8 into pytorch:master May 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: contrib Contrib module module: handlers Core Handlers module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EpochOutputStore can optionally store the data to the state

2 participants