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

Allow withgradient to pass aux info, and add @grad dropout #162

Merged
merged 6 commits into from
Mar 3, 2024

Conversation

mcabbott
Copy link
Member

@mcabbott mcabbott commented Mar 2, 2024

This upgrades withgradient to match the Zygote one:

julia> using Tracker

julia> withgradient(nt, 2) do x, p
         (; loss = sum(abs2, x.vec) ^ p, aux = x.vec)
       end
(val = (loss = 25.0, aux = [1.0, 2.0]), grad = ((vec = [20.0, 40.0], mat = [0.0;;], fun = nothing), nothing))

And it adds a rule for NNlib.dropout, which previously gave an error.

(These are united only by trying to make Flux work with Tracker again.)

@mcabbott mcabbott changed the title Allow withgradient to pass aux info Allow withgradient to pass aux info, and add @grad dropout Mar 2, 2024
Copy link

codecov bot commented Mar 2, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 73.10%. Comparing base (bff6a0c) to head (c6ed3b1).

Files Patch % Lines
src/lib/array.jl 80.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #162      +/-   ##
==========================================
- Coverage   73.30%   73.10%   -0.21%     
==========================================
  Files           9        9              
  Lines         708      725      +17     
==========================================
+ Hits          519      530      +11     
- Misses        189      195       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@coveralls
Copy link

coveralls commented Mar 2, 2024

Pull Request Test Coverage Report for Build 8123435238

Details

  • 18 of 21 (85.71%) changed or added relevant lines in 2 files are covered.
  • 4 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.2%) to 73.103%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/lib/array.jl 12 15 80.0%
Files with Coverage Reduction New Missed Lines %
src/lib/array.jl 4 67.02%
Totals Coverage Status
Change from base Build 7535386303: -0.2%
Covered Lines: 530
Relevant Lines: 725

💛 - Coveralls

@ChrisRackauckas ChrisRackauckas merged commit 01bc050 into FluxML:master Mar 3, 2024
5 of 6 checks passed
@mcabbott mcabbott deleted the withgrad_aux branch March 10, 2024 20:58
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.

4 participants