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

cleanup Flux.Losses documentation #1930

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

cleanup Flux.Losses documentation #1930

wants to merge 6 commits into from

Conversation

CarloLucibello
Copy link
Member

afterthought of #1928

docs/make.jl Outdated
@@ -1,6 +1,11 @@
using Documenter, Flux, NNlib, Functors, MLUtils

DocMeta.setdocmeta!(Flux, :DocTestSetup, :(using Flux); recursive = true)
DocMeta.setdocmeta!(Flux.Losses, :DocTestSetup, :(using Flux.Losses); recursive = true)
Copy link
Member Author

Choose a reason for hiding this comment

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

it seems this line is not doing its job and docs CI is failing because of this

Copy link
Member

Choose a reason for hiding this comment

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

I believe these lines are useless since makedocs have the tests disabled. In the GH CI.yml, there is a separate version of these lines, and that's the one that matters.

Copy link
Member Author

Choose a reason for hiding this comment

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

turns out that there is an additional problem, DocMeta.setdocmeta! doesn't accept the DocTestFilters that I also needed, so I had to revert this change entirely

Comment on lines -41 to 39
julia> Flux.mse(y_model, y_true)
julia> mse(y_model, y_true)
0.010000000000000018
Copy link
Member

@mcabbott mcabbott Apr 6, 2022

Choose a reason for hiding this comment

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

Why change these?

Elsewhere in Flux, all (ideally!) non-exported functions are qualified in doctests. It seems important to know you have to, seems bad to write examples which won't work at the repl.

Maybe the logic is that we are inside the module Losses, but (IMO) expecting confused users to be aware of such internal details is asking a lot. Better the Flux examples all work after loading Flux.

Copy link
Member Author

Choose a reason for hiding this comment

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

added using Flux.Losses: mse statements

docs/src/models/losses.md Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

Merging #1930 (567dbc1) into master (d317492) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1930   +/-   ##
=======================================
  Coverage   86.65%   86.65%           
=======================================
  Files          18       18           
  Lines        1416     1416           
=======================================
  Hits         1227     1227           
  Misses        189      189           
Impacted Files Coverage Δ
src/losses/functions.jl 98.64% <100.00%> (ø)

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 d317492...567dbc1. Read the comment docs.

@ToucheSir
Copy link
Member

Thoughts on rebasing this since we've had some QoL changes to the docs build recently? cc @Saransh-cpp

@Saransh-cpp
Copy link
Member

Yes, rebasing should work! Additionally, I think these lines -

# In this file, doctests which differ in the printed Float32 values won't fail
```@meta
DocTestFilters = r"[0-9\.]+f0"
```

are redundant, and can be removed.

Rebase should also get the DocBot to comment here. Currently, the updated docs can be viewed through the documenter/deploy action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants