Skip to content

Commit

Permalink
bump version, update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
janfb committed Aug 20, 2024
1 parent 3e4ec5d commit df7fcbe
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 77 deletions.
62 changes: 19 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,28 @@ implements diverse conditional density estimators.
This package provides pass-through access to all the
functionalities of [nflows](https://github.com/bayesiains/nflows).

## Setup
## Installation

Clone the repo and install all the dependencies using the
`environment.yml` file to create a conda environment: `conda env
create -f environment.yml`. If you already have a `pyknos` environment
and want to refresh dependencies, just run `conda env update -f
environment.yml --prune`.
`pyknos` requires Python 3.8 or higher. A GPU is not required, but can lead to speed-up
in some cases. We recommend using a
[`conda`](https://docs.conda.io/en/latest/miniconda.html) virtual environment
([Miniconda installation instructions](https://docs.conda.io/en/latest/miniconda.html)).
If `conda` is installed on the system, an environment for installing `pyknos` can be
created as follows:

Alternatively, you can install via `setup.py` using `pip install -e
".[dev]"` (the dev flag installs development and testing
dependencies).
```commandline
$ conda create -n pyknos_env python=3.12 && conda activate pyknos_env
```

## Examples

Examples are collected in notebooks in `examples/`.

## Binary files and Jupyter notebooks

### Using
Independent of whether you are using `conda` or not, `pyknos` can be installed using `pip`:

We use git lfs to store large binary files. Those files are not
downloaded by cloning the repository, but you have to pull them
separately. To do so follow installation instructions here
[https://git-lfs.github.com/](https://git-lfs.github.com/). In
particular, in a freshly cloned repository on a new machine, you will
need to run both `git-lfs install` and `git-lfs pull`.
```commandline
pip install pyknos
```

### Contributing

We use a filename filter to identify large binary files. Once you
installed and pulled git lfs you can add a file to git lfs by
appending `_gitlfs` to the basename, e.g., `oldbase_gitlfs.npy`. Then
add the file to the index, commit, and it will be tracked by git lfs.
## Examples

Additionally, to avoid large diffs due to Jupyter notebook outputs we
are using `nbstripout` to remove output from notebooks before every
commit. The `nbstripout` package is downloaded automatically during
installation of `pyknos`. However, **please make sure to set up the
filter yourself**, e.g., through `nbstriout --install` or with
different options as described
[here](https://github.com/kynan/nbstripout).
See the [`sbi` repository](https://github.com/sbi-dev/sbi) for examples of using pyknos.

## Name

Expand All @@ -62,21 +43,16 @@ pyknós (πυκνός) is the transliterated Greek root for density
## Copyright notice

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
it under the terms of the Apache License 2.0., see LICENSE for more details.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.

## Acknowledgements
## Acknowledgments

Thanks to Artur Bekasov, Conor Durkan and George Papamarkarios for
their work on [nflows](https://github.com/bayesiains/nflows).

The MDN implementation in this package is by Conor M. Durkan.
The MDN implementation in this package is based on Conor M. Durkan's.
31 changes: 0 additions & 31 deletions environment.yml

This file was deleted.

5 changes: 2 additions & 3 deletions pyknos/__version__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This file is part of pyknos, a library for conditional density estimation.
# pyknos is licensed under the Affero General Public License v3,
# see <https://www.gnu.org/licenses/>.
# pyknos is licensed under the Apache License 2.0., see LICENSE for more details.

VERSION = (0, 15, 2)
VERSION = (0, 16, 0)

__version__ = ".".join(map(str, VERSION))
3 changes: 3 additions & 0 deletions pyknos/mdn/mdn.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
C. M. Bishop, "Mixture Density Networks", NCRG Report (1994)
Taken from http://github.com/conormdurkan/lfi. See there for copyright.
# This file is part of pyknos, a library for conditional density estimation.
# pyknos is licensed under the Apache License 2.0., see LICENSE for more details.
"""

import warnings
Expand Down
3 changes: 3 additions & 0 deletions tests/mdn_test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This file is part of pyknos, a library for conditional density estimation.
# pyknos is licensed under the Apache License 2.0., see LICENSE for more details.

from typing import Optional

import pytest
Expand Down

0 comments on commit df7fcbe

Please sign in to comment.