Skip to content

Commit

Permalink
Merge pull request #187 from lnccbrown/157-docs-header
Browse files Browse the repository at this point in the history
Fix `Param` creation and update docs for `v0.1.1` release
  • Loading branch information
digicosmos86 authored Jul 11, 2023
2 parents 6d5c72d + abd87f1 commit 27cfb06
Show file tree
Hide file tree
Showing 40 changed files with 20,748 additions and 10,786 deletions.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
![PyPI](https://img.shields.io/pypi/v/hssm)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/hssm)
![GitHub pull requests](https://img.shields.io/github/issues-pr/lnccbrown/HSSM)
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/lnccbrown/HSSM/run_tests.yml)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)

<p align="left">
<img src="docs/images/mainlogo.png" width="250">
</p>

## HSSM - Hierarchical Sequential Sampling Modeling

![PyPI](https://img.shields.io/pypi/v/hssm)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/hssm)
![GitHub pull requests](https://img.shields.io/github/issues-pr/lnccbrown/HSSM)
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/lnccbrown/HSSM/run_tests.yml)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)

### Overview

HSSM is a Python toolbox that provides a seamless combination of state-of-the-art likelihood approximation methods with the wider ecosystem of probabilistic programming languages. It facilitates flexible hierarchical model building and inference via modern MCMC samplers. HSSM is user-friendly and provides the ability to rigorously estimate the impact of neural and other trial-by-trial covariates through parameter-wise mixed-effects models for a large variety of cognitive process models.
Expand Down
13 changes: 13 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changelog

## 0.1.x

### 0.1.1

- Handle `float` types in `PyTensor` and `JAX` more consistently and explicitly.
- Updated model output format to include likelihood kinds and display bounds more consistently.
- Support for `inf`s in bounds.
- Convenient method for simulating data with `ssm_simulators`.
- More test coverage.
- CI workflows for publishing package to PyPI.
- Enhancement to documentations.
51 changes: 25 additions & 26 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ HSSM is a Python toolbox that provides a seamless combination of state-of-the-ar

**License**: HSSM is licensed under [Copyright 2023, Brown University, Providence, RI](../LICENSE)

**Version**: 0.1.0
**Version**: 0.1.1

- Allows approximate hierarchical Bayesian inference via various likelihood approximators.
- Estimate impact of neural and other trial-by-trial covariates via native hierarchical mixed-regression support.
Expand All @@ -32,48 +32,44 @@ HSSM is a Python toolbox that provides a seamless combination of state-of-the-ar
```
pip install hssm
```

You can also install the bleeding edge version of `hssm` directly from this repo:

```
pip install git+https://github.com/lnccbrown/hssm.git
pip install git+https://github.com/lnccbrown/HSSM.git
```

### Optional Installation
### Optional dependencies

**Dependency for graph() Function**

Note: In addition to the installation of the main hssm class, there is an optional dependency for the graph() function. This dependency requires graphviz, which can be installed conveniently using conda with the following command:
!!! note

```
conda install -c conda-forge python-graphviz
```
Alternatively, you have the option to install the graphviz binaries manually and then install the Python bindings using pip with the following command:
In addition to the installation of the main hssm class, there is an optional dependency for the graph() function. This dependency requires graphviz, which can be installed conveniently using conda with the following command:

```bash
conda install -c conda-forge python-graphviz
```

Alternatively, you have the option to install the graphviz binaries manually and then install the Python bindings using pip with the following command:

```bash
pip install graphviz
```

```
pip install graphviz
```
**Dependency for sampler="nuts_numpyro"**

To utilize the nuts_numpyro sampler, please follow these steps:
`numpyro` needs to be installed to use the `nuts_numpyro` sampler:

1. Install numpyro by executing the following command:
```
```bash
pip install numpyro
```
2. Import the necessary modules and configure the required settings:
```
import numpyro
from jax.config import config

numpyro.set_host_device_count(jax.local_device_count())
config.update("jax_enable_x64", False)
```
For more information please refer to [jax documentation](https://jax.readthedocs.io/en/latest/installation.html).
### Setting global float type

### Setting a global float32
Using the analytical DDM (Drift Diffusion Model) likelihood in PyMC without forcing float type to `"float32"` in PyTensor may result in warning messages during sampling, which is a known bug in PyMC v5.6.0 and earlier versions. We can use `hssm.set_floatX("float32")` to get around this.
Using the analytical DDM (Drift Diffusion Model) likelihood in PyMC without forcing float type to `"float32"` in PyTensor may result in warning messages during sampling, which is a known bug in PyMC v5.6.0 and earlier versions. We can use `hssm.set_floatX("float32")` to get around this for now.

```
```python
hssm.set_floatX("float32")
```

Expand Down Expand Up @@ -112,11 +108,14 @@ model = hssm.HSSM(
model.sample()
```

## Example
## License

HSSM is licensed under [Copyright 2023, Brown University, Providence, RI](LICENSE)

## Support

For questions, bug reports, or other unexpected issues, please open an issue on the GitHub repository.

## Contributing

If you want to contribute to this project, please familiarize yourself with our [contribution guidelines](CONTRIBUTING.md).
19 changes: 19 additions & 0 deletions docs/overrides/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% extends "base.html" %}

{% block announce %}
<span class="show-on-small right-margin">
<span class="twemoji right-margin show-on-small move-down">
{% include ".icons/fontawesome/solid/angles-down.svg" %}
</span>
Navigate the site here!
</span>
<span>
<span class="twemoji">
{% include ".icons/material/head-question.svg" %}
</span>
Questions?
<a href="https://github.com/lnccbrown/HSSM/issues">
Open an issue here!
</a>
</span>
{% endblock %}
27 changes: 27 additions & 0 deletions docs/styles/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,30 @@
padding-top: 1.3em;
padding-left: 1.0em;
}

.right-margin {
margin-right: 10px;
}

@media screen and (min-width: 1220px) {
.show-on-small {
display: none
}
}

.move-down {
transform: translate(0px, -5px);
animation: down_movement 1000ms infinite ease-out;
}

@keyframes down_movement {
to {
transform: translate(0px, 5px);
}
}

.question {
color: pink;
width: 35px;
height: 35px;
}
Loading

0 comments on commit 27cfb06

Please sign in to comment.