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

Tagger decoder config override and auxiliary validation checks #3222

Merged
merged 8 commits into from
Mar 8, 2023

Conversation

arnavgarg1
Copy link
Contributor

This PR ensures that tagger decoders for text and sequence features are used correctly within Ludwig. Here are the the main changes addressed by this PR:

  1. If a config has no text/sequence/timeseries input features but uses a text/sequence tagger decoder output feature, it will raise a ConfigValidationError.
  2. If at least one text/sequence/timeseries feature does not use reduce_output=None, then it will raise a ConfigValidationError because the tagger decoder won't receive a b x s x h (3D) input from the combiner.
  3. The tagger decoder requires reduce_input for text/sequence output features to be set to None to prevent the hidden tensors from being reshaped to 2D. The default value for reduce_input is set to sum since it is the more popular case, but will be overridden during ModelConfig object creation when a tagger decoder is being used, and logs a warning. This is because this is an implementation detail Ludwig users should not have to worry about since it relates to tensor shapes directly.

I've also added a few different tests for text and sequence output features, as well as a test for a config that does not have a text/sequence/timeseries input feature to make sure all of these different cases are correctly tested and accounted for.

ludwig/config_validation/checks.py Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Mar 8, 2023

Unit Test Results

         6 files           6 suites   6h 21m 25s ⏱️
  4 050 tests   4 007 ✔️   43 💤 0
12 171 runs  12 036 ✔️ 135 💤 0

Results for commit cf8966e.

♻️ This comment has been updated with latest results.

@arnavgarg1 arnavgarg1 merged commit 32d305e into master Mar 8, 2023
@arnavgarg1 arnavgarg1 deleted the tagger_decoder branch March 8, 2023 23:58
justinxzhao pushed a commit that referenced this pull request Mar 22, 2023
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
justinxzhao added a commit that referenced this pull request Mar 23, 2023
…3222) (#3283)

Co-authored-by: Arnav Garg <106701836+arnavgarg1@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@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.

None yet

4 participants