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

avoid initializing with Y if X is set #466

Merged
merged 1 commit into from
Feb 17, 2021

Conversation

svlandeg
Copy link
Member

@svlandeg svlandeg commented Feb 5, 2021

Inspired by this issue. The "trouble" is being caused by the shape inference code in chain, but it can't hurt to add some additional robustness into layernorm to avoid using Y if not necessary.

@codecov
Copy link

codecov bot commented Feb 5, 2021

Codecov Report

Merging #466 (c7cae55) into master (ca42188) will decrease coverage by 0.19%.
The diff coverage is 61.86%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #466      +/-   ##
==========================================
- Coverage   59.66%   59.47%   -0.20%     
==========================================
  Files         100      101       +1     
  Lines        7079     7285     +206     
==========================================
+ Hits         4224     4333     +109     
- Misses       2855     2952      +97     
Impacted Files Coverage Δ
thinc/layers/logistic.py 100.00% <ø> (ø)
thinc/layers/reduce_first.py 100.00% <ø> (ø)
thinc/layers/reduce_last.py 100.00% <ø> (ø)
thinc/tests/layers/test_layers_api.py 0.00% <ø> (ø)
thinc/tests/layers/test_with_transforms.py 0.00% <0.00%> (ø)
thinc/layers/layernorm.py 90.90% <50.00%> (-9.10%) ⬇️
thinc/backends/ops.py 83.58% <76.92%> (+0.07%) ⬆️
thinc/about.py 100.00% <100.00%> (ø)
thinc/api.py 100.00% <100.00%> (ø)
thinc/config.py 97.05% <100.00%> (+0.98%) ⬆️
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3d5ab74...c7cae55. Read the comment docs.

@svlandeg
Copy link
Member Author

svlandeg commented Feb 6, 2021

How is this little PR suddenly triggering mypy issues? mypy 0.8 was out already 15 days ago, and master was still building correctly 13 days ago (with the same mypy version), so that can't be it?

@adrianeboyd
Copy link
Contributor

This is probably also related to the newest version of numpy, but I'm not sure why it looks different than in #465, which didn't fail until the test suite.

@svlandeg
Copy link
Member Author

svlandeg commented Feb 6, 2021

Hm, I guess we'll see when the other PR is merged whether it also fixes this one 🤞

@adrianeboyd adrianeboyd closed this Feb 9, 2021
@adrianeboyd adrianeboyd reopened this Feb 9, 2021
@justindujardin
Copy link
Contributor

I'm late to this conversation, but you're right, the failures were related to the latest numpy release.

I added some # type: ignore comments in the test suite to fix them

The latest numpy release has its own type hints, so our usages in thinc don't completely line up.

At some point we could probably benefit from using the built-in numpy types in thinc, but for now a few comments did the trick. 😅

@adrianeboyd adrianeboyd merged commit 71d285b into explosion:master Feb 17, 2021
@svlandeg svlandeg deleted the fix/layernorm_init branch February 17, 2021 13:13
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.

3 participants