-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into chex_test_for_rmh
- Loading branch information
Showing
69 changed files
with
2,744 additions
and
2,034 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
version: 2 | ||
|
||
python: | ||
version: "3.8" | ||
version: "3.9" | ||
install: | ||
- method: pip | ||
path: . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Guidelines for Contributing | ||
|
||
Thank you for interested in contributing to Blackjax! We value the following contributions: | ||
|
||
- Bug fixes | ||
- Documentation | ||
- High-level sampling algorithms from any family of algorithms: random walk, | ||
hamiltonian monte carlo, sequential monte carlo, variational inference, | ||
inference compilation, etc. | ||
- New building blocks, e.g. new metrics for HMC, integrators, etc. | ||
|
||
## How to contribute? | ||
|
||
1. Run `pip install -r requirements.txt` to install all the dev | ||
dependencies. | ||
2. Run `pre-commit run --all-files` and `make test` before pushing on the repo; CI should pass if | ||
these pass locally. | ||
|
||
## Editing documentations | ||
|
||
The Blackjax repository (and [sampling-book](https://github.com/blackjax-devs/sampling-book)) provides examples in the form of Markdown documents. [Jupytext](https://github.com/mwouts/jupytext) can be used by the users to convert their Jupyter notebooks to this format, or convert these documents to Jupyter notebooks. Examples are rendered in the [documentation](https://blackjax-devs.github.io/blackjax/). | ||
|
||
### Load examples in a Jupyter notebook | ||
|
||
To convert any example file to a Jupyter notebook you can use: | ||
|
||
```shell | ||
jupytext docs/examples/your_example_file.md --to notebook | ||
``` | ||
|
||
you can then interact with the resulting notebook just like with any notebook. | ||
|
||
### Convert my Jupyter notebook to markdown | ||
|
||
If you implemented your example in a Jupyter notebook you can convert your `.ipynb` file to Markdown using the command below: | ||
|
||
```shell | ||
jupytext docs/examples/your_example_notebook.ipynb --to myst | ||
``` | ||
|
||
Once the example file is converted to a Markdown file, you have two options for editing: | ||
|
||
1. Edit the Markdown version as it is a regular Markdown file. | ||
2. Edit the Notebook version, then convert it to a Markdown file once you finish editing with the command above. Jupytext can handle the change if the example has the same file name. | ||
|
||
**Please make sure to only commit the Markdown file.** | ||
|
||
### Composing Documentation on Sphinx-Doc | ||
|
||
We use `Sphinx` to generate documents for this repo. We highly encourage you to check how your changes to the examples are rendered in the documentation: | ||
|
||
1. Add your documentation to `docs/examples.rst` | ||
2. Run the command below: | ||
|
||
```shell | ||
make build-docs | ||
``` | ||
|
||
3. Check the generated HTML documentation in `docs/_build` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright 2020- The Blackjax Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
from typing import NamedTuple | ||
|
||
from blackjax.types import ArrayTree | ||
|
||
|
||
class AdaptationResults(NamedTuple): | ||
state: ArrayTree | ||
parameters: dict | ||
|
||
|
||
class AdaptationInfo(NamedTuple): | ||
state: NamedTuple | ||
info: NamedTuple | ||
adaptation_state: NamedTuple |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.