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

feat: get_dataset_from_params added #1231

Merged
merged 3 commits into from
Jun 14, 2021
Merged

feat: get_dataset_from_params added #1231

merged 3 commits into from
Jun 14, 2021

Conversation

bagxi
Copy link
Member

@bagxi bagxi commented Jun 7, 2021

Before submitting (checklist)

  • 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?
  • Did you run colab minimal CI/CD with latest and minimal requirements?

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.

FAQ

Please review the FAQ before submitting an issue:

@bagxi bagxi force-pushed the dataset_from_params branch 3 times, most recently from ef2c857 to c756ca5 Compare June 8, 2021 06:11
catalyst/utils/data.py Show resolved Hide resolved
examples/mnist_stages/config.yml Outdated Show resolved Hide resolved
examples/mnist_stages/config.yml Outdated Show resolved Hide resolved
@bagxi bagxi force-pushed the dataset_from_params branch 3 times, most recently from 517266a to ff49914 Compare June 10, 2021 16:12
Comment on lines 18 to +19
def get_datasets(self, stage: str) -> "OrderedDict[str, Dataset]":
params = deepcopy(self._stage_config[stage]["loaders"]["datasets"])
Copy link
Member

Choose a reason for hiding this comment

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

is it okay, that we have to use params = deepcopy(self._stage_config[stage]["loaders"]["datasets"])?
from the users perspective?

Copy link
Member Author

Choose a reason for hiding this comment

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

Either deepcopy , or we should add method get_stage_config. Otherwise, there always be a chance of overwriting config params.

Comment on lines -54 to +66
# kwargs for `runner.get_datasets`:
num_samples_per_class: 320

datasets:
train:
_target_: MNIST
root: *dataset_root
train: True
download: True
num_samples_per_class: 320
valid:
_target_: MNIST
root: *dataset_root
train: False
download: True
Copy link
Member

@Scitator Scitator Jun 11, 2021

Choose a reason for hiding this comment

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

is it possible to run the previous Config API example without any code-changes/config-changes?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, dataset parameters were moved to datasets: level

@Scitator Scitator changed the base branch from master to develop June 14, 2021 07:24
@Scitator Scitator merged commit b33eaad into develop Jun 14, 2021
@mergify mergify bot deleted the dataset_from_params branch June 14, 2021 07:25
Scitator added a commit that referenced this pull request Jun 28, 2021
* feat: get_dataset_from_params added (#1231)

* feat: get_dataset_from_params (config api and hydra) added

* datasets added into registry

* rm @staticmethod

* feat: config transforms support (#1236)

* Update README.md

* feat: `get_transforms` PoC

* fix: HuberLoss workaround added (#1239)

Co-authored-by: Sergey Kolesnikov <scitator@gmail.com>

* feat: `get_samplers` from params (config API) added (#1240)

* feat: support of recursive get_from_params added (#1242)

* feat: support of nested lists and dicts for `registry.get_from_params` added (#1244)

* feat: support of nested lists and dicts added; instantiation from path to object added

* replace `_get_XXX_from_params` with `REGISTRY.get_from_params` in config API

* `ConfigRunner._get_loaders_from_params` added

* hydra-slayer: `meta_factory` support (#1247)

* feat: support of nested lists and dicts added; instantiation from path to object added

* replace `_get_XXX_from_params` with `REGISTRY.get_from_params` in config API

* support of `meta_factory` for `registry.get_from_params` added

Co-authored-by: Yauheni Kachan <19803638+bagxi@users.noreply.github.com>
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.

2 participants