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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Callback docs with autosummary #3908
Conversation
@@ -40,6 +40,7 @@ | |||
|
|||
class EarlyStopping(Callback): | |||
r""" | |||
Monitor a validation metric and stop training when it stops improving. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding this to appear the docstring in the left side of table row.
e.g: https://pytorch.org/docs/stable/nn.html#containers
col { | ||
width: 50% !important; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is needed as there is colgroup
html tag which apply width 10% to the right and 90% to the left.
Not sure where does first appear, can't inspect that in pytorch docs.
So manually setting it.
.. role:: hidden | ||
:class: hidden-section | ||
.. currentmodule:: {{ module }} | ||
|
||
|
||
{{ name | underline }} | ||
|
||
.. autoclass:: {{ name }} | ||
:members: | ||
|
||
|
||
.. | ||
autogenerated from source/_templates/classtemplate.rst | ||
note it does not have :inherited-members: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the template for autoclass
to appear like pytorch docs.
without this, the h1
will be module.{module}.class
, which is long for sub packages.
EDIT: copied from pytorch docs repo
Shall we show private methods? |
Codecov Report
@@ Coverage Diff @@
## master #3908 +/- ##
=======================================
+ Coverage 83% 86% +2%
=======================================
Files 117 117
Lines 9237 9471 +234
=======================================
+ Hits 7689 8117 +428
+ Misses 1548 1354 -194 |
Changes here: https://61555-178626720-gh.circle-artifacts.com/0/html/callbacks.html#built-in-callbacks In ModelCheckpoint or some other like, referencing to other classes, class's params will not show the link as the referencing link for those isn't include in this PR as Created In the latest docs, those ref links point to |
very nice :] |
* callback docs with autosummary * do not show private methods * callback base docstring
Unfortunately, autosummary exports the class with autoclass, function with autofunction So, appending heading is kinda hard. |
What the PR does linking the source code to the docs from _modules folder. For methods like training_step in LightningModule docs can be solved with automethod. It can be said that PR is relevant or not relevant. The core team needs to decide source will link to github or link to _modules folder. |
* base * add xfail * new test * import * missing import * xfail if not installed include mkpatch fix test * mock comet comet mocks fix test remove dep undo merge duplication * line * line * convert doctest * doctest * docs * prune Results usage in notebooks (#3911) * notebooks * notebooks * revamp entire metrics (#3868) * removed metric Co-authored-by: Teddy Koker <teddy.koker@gmail.com> * added new metrics Co-authored-by: Teddy Koker teddy.koker@gmail.com * pep8 Co-authored-by: Teddy Koker teddy.koker@gmail.com * pep8 Co-authored-by: Teddy Koker <teddy.koker@gmail.com> * docs Co-authored-by: Teddy Koker <teddy.koker@gmail.com> * docs Co-authored-by: Teddy Koker <teddy.koker@gmail.com> * win ddp tests skip Co-authored-by: Teddy Koker <teddy.koker@gmail.com> * win ddp tests skip Co-authored-by: Teddy Koker <teddy.koker@gmail.com> * win ddp tests skip Co-authored-by: Teddy Koker <teddy.koker@gmail.com> * win ddp tests skip Co-authored-by: Teddy Koker <teddy.koker@gmail.com> * reset in compute, cache compute Co-authored-by: Teddy Koker <teddy.koker@gmail.com> * reduce_ops handling Co-authored-by: Teddy Koker <teddy.koker@gmail.com> * sync -> sync_dist, type annotations Co-authored-by: Teddy Koker <teddy.koker@gmail.com> * wip docs Co-authored-by: Teddy Koker <teddy.koker@gmail.com> * mean squared error * docstring * added mean ___ error metrics * added mean ___ error metrics * seperated files * accuracy doctest * gpu fix * remove unnecessary mixin * metric and accuracy docstring Co-authored-by: Teddy Koker <teddy.koker@gmail.com> * metric docs Co-authored-by: Teddy Koker <teddy.koker@gmail.com> * pep8, changelog Co-authored-by: Teddy Koker <teddy.koker@gmail.com> * refactor dist utils, pep8 * refactor dist utils, pep8 Co-authored-by: Teddy Koker <teddy.koker@gmail.com> * Callback docs with autosummary (#3908) * callback docs with autosummary * do not show private methods * callback base docstring * skip some docker builds (temporally pass) (#3913) * skip some docker builds * todos * skip * use badges only with push (#3914) * testtube * mock test tube * mock mlflow * remove mlflow * clean up * test * test * test * test * test * test * code blocks * remove import * codeblock * logger * wandb causes stall Co-authored-by: William Falcon <waf2107@columbia.edu> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: Ananya Harsh Jha <ananya@pytorchlightning.ai> Co-authored-by: Teddy Koker <teddy.koker@gmail.com> Co-authored-by: Jeff Yang <ydcjeff@outlook.com>
What does this PR do?
Fixes #2034
Before submitting
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.
Did you have fun?
Make sure you had fun coding 馃檭
@williamFalcon @Borda @awaelchli @edenlightning