Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] simplified runner proposal #984

Merged
merged 11 commits into from Nov 11, 2020
Merged

Conversation

Scitator
Copy link
Member

@Scitator Scitator commented Nov 3, 2020

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contribution guide?
  • Did you check the code style? catalyst-make-codestyle && catalyst-check-codestyle (pip install -U catalyst-codestyle).
  • Did you make sure to update the docs? We use Google format for all the methods and classes.
  • Did you check the docs with make check-docs?
  • Did you write any new necessary tests?
  • Did you check that your code passes the unit tests pytest . ?
  • Did you add your new functionality to the docs?
  • Did you update the CHANGELOG?

Description

Related Issue

Type of Change

  • Examples / docs / tutorials / contributors update
  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves an existing feature)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

PS

  • I know, that I could join slack for pull request discussion.


def _init(self, **kwargs):
self.experiment: Experiment = None
def __init__(
Copy link

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
D107 Missing docstring in init

@@ -1,13 +1,14 @@
from typing import Any, Callable, Dict, Mapping, Optional, Tuple, Union
from typing import Any, Callable, Dict, Mapping, Optional, Tuple, Union, List
Copy link

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
F401 'typing.Tuple' imported but unused

@@ -1,13 +1,14 @@
from typing import Any, Callable, Dict, Mapping, Optional, Tuple, Union
from typing import Any, Callable, Dict, Mapping, Optional, Tuple, Union, List
Copy link

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
I001 isort found an import in the wrong position

) -> Tuple[Model, Criterion, Optimizer, Scheduler, Device]:
"""
Inner method for `Experiment` components preparation.
def on_experiment_start(self, runner: "IRunner"):
Copy link

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
D102 Missing docstring in public method


Check available torch device, takes model from the experiment
and creates stage-specified criterion, optimizer, scheduler for it.
def on_stage_start(self, runner: "IRunner"):
Copy link

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
D102 Missing docstring in public method

def _prepare_for_epoch(self, stage: str, epoch: int) -> None:
"""
Inner method to prepare `Runner` for the specified stage and epoch.
def on_epoch_end(self, runner: "IRunner"):
Copy link

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
D102 Missing docstring in public method

like "pretrain" / "train" / "finetune" / etc
epoch: epoch index
"""
def on_stage_end(self, runner: "IRunner"):
Copy link

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
D102 Missing docstring in public method

pass

def on_experiment_end(self, runner: "IRunner"):
Copy link

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
D102 Missing docstring in public method

def on_experiment_end(self, runner: "IRunner"):
pass

def on_exception(self, runner: "IRunner"):
Copy link

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
D102 Missing docstring in public method


# example 3
runner.get_attr("scheduler", "adam")
# is equivalent to
Copy link

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
DAR101 Missing parameter(s) in Docstring: - obj

@Scitator Scitator changed the title proposal [wip] simplifier runner proposal Nov 5, 2020
@Scitator Scitator changed the title [wip] simplifier runner proposal [wip] simplified runner proposal Nov 5, 2020
@@ -1,13 +1,14 @@
from typing import Any, Callable, Dict, Mapping, Optional, Tuple, Union
from typing import Any, Callable, Dict, List, Mapping, Optional, Tuple, Union
Copy link

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
F401 'typing.List' imported but unused

Prepares callbacks with `self._get_experiment_callbacks`.
Prepares inner state with `self._prepare_inner_state`
Additionally sets `Experiment` datasources for specified stage.
def on_stage_start(self, runner: "IRunner"):
Copy link

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
D102 Missing docstring in public method

@mergify
Copy link

mergify bot commented Nov 10, 2020

This pull request is now in conflicts. @Scitator, could you fix it? 🙏

@Scitator Scitator merged commit dd7be23 into master Nov 11, 2020
@mergify mergify bot deleted the arch/runner-simplification branch November 11, 2020 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant