diff --git a/README.md b/README.md index 22559da..aad8897 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 . - -## 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. diff --git a/environment.yml b/environment.yml deleted file mode 100644 index a0154e9..0000000 --- a/environment.yml +++ /dev/null @@ -1,31 +0,0 @@ -# -# Create: -# $ conda env create --file environment.yml -# -# Update: -# $ conda env update --file environment.yml --prune -# -# Activate: -# $ conda activate pyknos - -name: pyknos - -channels: - - conda-forge - - pytorch - -dependencies: - - cudatoolkit - - jupyter - - jupyterlab - - matplotlib - - notebook - - numpy - - pip - - pip: - - "nflows==0.14" - - -e ".[dev]" - - "python >= 3.6.0" - - "pytorch >= 1.5.1" - - tensorboard - - tqdm diff --git a/pyknos/__version__.py b/pyknos/__version__.py index ff1f3af..91286d1 100644 --- a/pyknos/__version__.py +++ b/pyknos/__version__.py @@ -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 . +# 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)) diff --git a/pyknos/mdn/mdn.py b/pyknos/mdn/mdn.py index f451e18..340599d 100644 --- a/pyknos/mdn/mdn.py +++ b/pyknos/mdn/mdn.py @@ -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 diff --git a/tests/mdn_test.py b/tests/mdn_test.py index e53d09c..18c8c03 100644 --- a/tests/mdn_test.py +++ b/tests/mdn_test.py @@ -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