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

Mux up callback #1241

Merged
merged 47 commits into from Jul 15, 2021
Merged

Mux up callback #1241

merged 47 commits into from Jul 15, 2021

Conversation

Dokholyan
Copy link
Contributor

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:

@pep8speaks
Copy link

pep8speaks commented Jun 19, 2021

Hello @Dokholyan! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-07-12 15:36:51 UTC

Copy link
Member

@Scitator Scitator left a comment

Choose a reason for hiding this comment

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

looks good 👍

catalyst/callbacks/mixup.py Outdated Show resolved Hide resolved
catalyst/callbacks/mixup.py Outdated Show resolved Hide resolved
catalyst/callbacks/mixup.py Outdated Show resolved Hide resolved
catalyst/callbacks/mixup.py Outdated Show resolved Hide resolved
catalyst/callbacks/mixup.py Outdated Show resolved Hide resolved
catalyst/callbacks/mixup.py Outdated Show resolved Hide resolved
catalyst/callbacks/mixup.py Show resolved Hide resolved
catalyst/utils/mixup.py Show resolved Hide resolved
Scitator
Scitator previously approved these changes Jul 5, 2021
Copy link
Contributor Author

@Dokholyan Dokholyan left a comment

Choose a reason for hiding this comment

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

?

catalyst/callbacks/mixup.py Outdated Show resolved Hide resolved
catalyst/utils/mixup.py Outdated Show resolved Hide resolved
catalyst/utils/mixup.py Outdated Show resolved Hide resolved
augmented batch

"""
assert isinstance(keys, list), f"keys must be list[str], get: {type(keys)}"
Copy link
Member

Choose a reason for hiding this comment

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

I'd appreciate it if we could check not for lists only, but for other iterables too, for example, tuples

"""
assert isinstance(keys, list), f"keys must be list[str], get: {type(keys)}"
assert alpha >= 0, "alpha must be>=0"
assert mode in ["add", "replace"], f"mode must be in 'add', 'replace', get: {mode}"
Copy link
Member

Choose a reason for hiding this comment

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

I'd appreciate it if we could use tuple or set here instead of a list

catalyst/utils/mixup.py Outdated Show resolved Hide resolved
catalyst/utils/mixup.py Outdated Show resolved Hide resolved
catalyst/utils/mixup.py Outdated Show resolved Hide resolved
)

.. note::
With running this callback, many metrics (for example, accuracy) become undefined, so
Copy link
Member

Choose a reason for hiding this comment

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

"By running ..." ?

"""
assert isinstance(keys, (str, list)), f"keys must be str of list[str], get: {type(keys)}"
assert alpha >= 0, "alpha must be>=0"
assert mode in ["add", "replace"], f"mode must be in 'add', 'replace', get: {mode}"
Copy link
Member

Choose a reason for hiding this comment

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

I'd appreciate it if we could use tuple or set here instead of a list

catalyst/callbacks/mixup.py Outdated Show resolved Hide resolved
@Scitator
Copy link
Member

Scitator commented Jul 8, 2021

btw, is it possible to merge this callback with https://github.com/catalyst-team/catalyst/blob/master/catalyst/callbacks/batch_transform.py#L17 ?

Co-authored-by: Yauheni Kachan <19803638+bagxi@users.noreply.github.com>
@mergify mergify bot dismissed Scitator’s stale review July 8, 2021 20:09

Pull request has been modified.

Dokholyan and others added 8 commits July 8, 2021 23:10
Co-authored-by: Yauheni Kachan <19803638+bagxi@users.noreply.github.com>
Co-authored-by: Yauheni Kachan <19803638+bagxi@users.noreply.github.com>
Co-authored-by: Yauheni Kachan <19803638+bagxi@users.noreply.github.com>
@Dokholyan
Copy link
Contributor Author

@Scitator about BatchTransformCallback, I thought about it, but I don't know how to introduce а on_train_only mode

catalyst/utils/mixup.py Outdated Show resolved Hide resolved
@mergify mergify bot dismissed Scitator’s stale review July 12, 2021 15:37

Pull request has been modified.

Copy link
Member

@Scitator Scitator left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Member

@Scitator Scitator left a comment

Choose a reason for hiding this comment

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

btw, @Dokholyan could you please add your update to the Changelog.md?

@Scitator Scitator merged commit a238ed4 into catalyst-team:master Jul 15, 2021
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

4 participants