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

Documentation facelift #242

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/deploy-mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: ci
on:
push:
branches:
- master
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,28 +450,25 @@ For example, currently the [`curvature.CurvlinopsInterface`](https://github.com/

## Documentation

The documentation is available [here](https://aleximmer.github.io/Laplace) or can be generated and/or viewed locally:
The documentation is available [here](https://aleximmer.github.io/Laplace) or can be
generated and/or viewed locally:

**With `uv`**

```bash
# assuming the repository was cloned
uv sync --all-extras
# create docs and write to html
uv run bash update_docs.sh
# .. or serve the docs directly
uv run pdoc --http 0.0.0.0:8080 laplace --template-dir template
# serve the docs on a liveserver
uv run mkdocs serve
```

**With `pip`**

```bash
# assuming the repository was cloned
pip install -e ".[dev]"
# create docs and write to html
bash update_docs.sh
# .. or serve the docs directly
pdoc --http 0.0.0.0:8080 laplace --template-dir template
# serve the docs on a liveserver
mkdocs serve
```

## Contributing
Expand All @@ -481,7 +478,9 @@ Pull requests are very welcome. Please follow these guidelines:
1. Follow the [development setup](#setup-dev-environment).
2. Use [ruff](https://github.com/astral-sh/ruff) as autoformatter. Please refer to the following [makefile](https://github.com/aleximmer/Laplace/blob/main/makefile) and run it via `make ruff`. Please note that the order of `ruff check --fix` and `ruff format` is important!
3. Also use [ruff](https://github.com/astral-sh/ruff) as linter. Please manually fix all linting errors/warnings before opening a pull request.
4. Fully document your changes in the form of Python docstrings, typehinting, and (if applicable) code/markdown examples in the `./examples` subdirectory.
4. Fully document your changes in the form of Python docstrings, typehinting.
5. Add tutorial-style documentation in both `docs/` (in the form of markdown files)
and `examples/` (in the form of runnable scripts) dirs.
5. Provide as many test cases as possible. Make sure all test cases pass.

Issues, bug reports, and ideas are also very welcome!
Expand Down
4 changes: 4 additions & 0 deletions docs/api_reference/baselaplace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
::: laplace.baselaplace
options:
members:
- BaseLaplace
17 changes: 17 additions & 0 deletions docs/api_reference/curvatures.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
::: laplace.curvature
options:
members:
- CurvatureInterface
- GGNInterface
- EFInterface
- AsdlInterface
- AsdlGGN
- AsdlEF
- AsdlHessian
- BackPackInterface
- BackPackGGN
- BackPackEF
- CurvlinopsInterface
- CurvlinopsGGN
- CurvlinopsEF
- CurvlinopsHessian
1 change: 1 addition & 0 deletions docs/api_reference/enums.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: laplace.utils.enums
4 changes: 4 additions & 0 deletions docs/api_reference/functionallaplace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
::: laplace.baselaplace
options:
members:
- FunctionalLaplace
4 changes: 4 additions & 0 deletions docs/api_reference/laplace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
::: laplace.laplace
options:
members:
- Laplace
7 changes: 7 additions & 0 deletions docs/api_reference/lllaplace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
::: laplace.lllaplace
options:
members:
- LLLaplace
- DiagLLLaplace
- KronLLLaplace
- FullLLLaplace
4 changes: 4 additions & 0 deletions docs/api_reference/marglik_training.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
::: laplace.marglik_training
options:
members:
- marglik_training
8 changes: 8 additions & 0 deletions docs/api_reference/parametriclaplace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
::: laplace.baselaplace
options:
members:
- ParametricLaplace
- DiagLaplace
- KronLaplace
- LowRankLaplace
- FullLaplace
6 changes: 6 additions & 0 deletions docs/api_reference/subnetlaplace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
::: laplace.subnetlaplace
options:
members:
- SubnetLaplace
- DiagSubnetLaplace
- FullSubnetLaplace
30 changes: 30 additions & 0 deletions docs/api_reference/utils.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
::: laplace.utils
options:
members:
- "get_nll"
- "validate"
- "parameters_per_layer"
- "invsqrt_precision"
- "kron"
- "diagonal_add_scalar"
- "symeig"
- "block_diag"
- "normal_samples"
- "SoDSampler"
- "_is_batchnorm"
- "_is_valid_scalar"
- "expand_prior_precision"
- "fix_prior_prec_structure"
- "FeatureExtractor"
- "Kron"
- "KronDecomposed"
- "fit_diagonal_swag_var"
- "SubnetMask"
- "RandomSubnetMask"
- "LargestMagnitudeSubnetMask"
- "LargestVarianceDiagLaplaceSubnetMask"
- "LargestVarianceSWAGSubnetMask"
- "ParamNameSubnetMask"
- "ModuleNameSubnetMask"
- "LastLayerSubnetMask"
- "RunningNLLMetric"
Binary file added docs/assets/laplace_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/laplace_logo_inv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading