lightning/docs
Karthik Venkataramani 88869ad482
docs: fix `y` var for compute loss (#19465)
* Update train_model_basic.rst

Loss should be calculated by comparing `x_hat` to `y`, not `x`

* Update evaluation_basic.rst

Error in the documentation where training loss is calculated as `F.mse_loss(x_hat, x)`. Changed to `F.mse_loss(x_hat, y)`

* Update notebooks.rst

Doc fix

* Update README.md

Doc fix

* Update introduction.rst

Doc fix

* Update train.py

Doc fix

* Update README.md

Doc fix

* Revert "Update train.py"

This reverts commit 1934760056.

* Revert "Update introduction.rst"

This reverts commit 0cec613c07.

* Revert "Update README.md"

This reverts commit fda3fbf32d.

* Revert "Update notebooks.rst"

This reverts commit 183a2a9e33.

* Revert "Update evaluation_basic.rst"

This reverts commit 0eefe39aea.

* Revert "Update train_model_basic.rst"

This reverts commit b98e1d2414.

* remove the variable y when unused in docs

* Update README.md

---------

Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
2024-03-15 17:56:28 -04:00
..
source-app docs: fix `y` var for compute loss (#19465) 2024-03-15 17:56:28 -04:00
source-fabric Add docs for the Fabric `WandbLogger` hosted in the `wandb` SDK (#19451) 2024-03-08 19:27:08 -05:00
source-pytorch docs: fix `y` var for compute loss (#19465) 2024-03-15 17:56:28 -04:00
README.md ci/docs: enable not fetch assets (#18333) 2023-08-21 20:22:21 +02:00
crossroad.html ci: build app's docs with RTFD (#19147) 2023-12-13 07:37:36 +01:00
generate_docs_for_tags.sh docs: build docs for specific tags (#17055) 2023-03-20 16:24:06 +00:00
redirect.html rtfd: fix building with stable/latest (#18615) 2023-09-23 07:40:22 +02:00
rtfd-build.sh ci: build app's docs with RTFD (#19147) 2023-12-13 07:37:36 +01:00

README.md

PyTorch-Lightning Docs

We are using Sphinx with Napoleon extension. Moreover, we set Google style to follow with type convention.

See following short example of a sample function taking one position string and optional

from typing import Optional


def my_func(param_a: int, param_b: Optional[float] = None) -> str:
    """Sample function.

    Args:
        param_a: first parameter
        param_b: second parameter

    Return:
        sum of both numbers

    Example::

        >>> my_func(1, 2)
        3

    Note:
        If you want to add something.
    """
    p = param_b if param_b else 0
    return str(param_a + p)

Building Docs

When updating the docs, make sure to build them first locally and visually inspect the html files in your browser for formatting errors. In certain cases, a missing blank line or a wrong indent can lead to a broken layout. Run these commands

git submodule update --init --recursive
make docs

and open docs/build/html/index.html in your browser.

When you send a PR the continuous integration will run tests and build the docs.

Notes:

  • You need to have LaTeX installed for rendering math equations. You can for example install TeXLive with the necessary extras by doing one of the following:
    • on Ubuntu (Linux) run sudo apt-get update && sudo apt-get install -y texlive-latex-extra dvipng texlive-pictures
    • use the RTD docker image
  • You need to have pandoc installed for rendering Jupyter Notebooks. On Ubuntu (Linux), you can run: sudo apt-get install pandoc

Developing docs

When developing the docs, building docs can be VERY slow locally because of the notebook tutorials. To speed this up, enable this flag in before building docs:

# builds notebooks which is slow
export FAST_DOCS_DEV=0

# fast notebook build which is fast
export FAST_DOCS_DEV=1

docs CSS/theme

To change the CSS theme of the docs, go here. Apologies in advance... this is a bit complex to build and requires basic understanding of javascript/npm.