ramsey


Nameramsey JSON
Version 0.2.1 PyPI version JSON
download
home_pagehttps://github.com/ramsey-devs/ramsey
SummaryProbabilistic deep learning using JAX
upload_time2023-10-23 12:51:21
maintainer
docs_urlNone
authorThe Ramsey developers
requires_python>=3.9
licenseApache 2.0
keywords bayes jax probabilistic deep learning probabilistic models neural process
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Ramsey

[![status](http://www.repostatus.org/badges/latest/concept.svg)](http://www.repostatus.org/#concept)
[![ci](https://github.com/dirmeier/ramsey/actions/workflows/ci.yaml/badge.svg)](https://github.com/dirmeier/ramsey/actions/workflows/ci.yaml)
[![codecov](https://codecov.io/gh/ramsey-devs/ramsey/branch/main/graph/badge.svg?token=dn1xNBSalZ)](https://codecov.io/gh/ramsey-devs/ramsey)
[![codacy](https://app.codacy.com/project/badge/Grade/ed13460537fd4ac099c8534b1d9a0202)](https://www.codacy.com/gh/ramsey-devs/ramsey/dashboard?utm_source=github.com&utm_medium=referral&utm_content=ramsey-devs/ramsey&utm_campaign=Badge_Grade)
[![documentation](https://readthedocs.org/projects/ramsey/badge/?version=latest)](https://ramsey.readthedocs.io/en/latest/?badge=latest)
[![version](https://img.shields.io/pypi/v/ramsey.svg?colorB=black&style=flat)](https://pypi.org/project/ramsey/)

> Probabilistic deep learning using JAX

## About

Ramsey is a library for probabilistic modelling using [JAX](https://github.com/google/jax),
[Flax](https://github.com/google/flax) and [NumPyro](https://github.com/pyro-ppl/numpyro).
It offers high quality implementations of neural processes, Gaussian processes, Bayesian time series and state-space models, clustering processes,
and everything else Bayesian.

Ramsey makes use of

- Flax`s module system for models with trainable parameters (such as neural or Gaussian processes),
- NumPyro for models where parameters are endowed with prior distributions (such as Gaussian processes, Bayesian neural networks, ARMA models)

and is hence aimed at being fully compatible with both of them.

## Example usage

You can, for instance, construct a simple neural process like this:

```python
from jax import random as jr

from ramsey import NP
from ramsey.nn import MLP
from ramsey.data import sample_from_sine_function

def get_neural_process():
    dim = 128
    np = NP(
        decoder=MLP([dim] * 3 + [2]),
        latent_encoder=(
            MLP([dim] * 3), MLP([dim, dim * 2])
        )
    )
    return np

key = jr.PRNGKey(23)
data = sample_from_sine_function(key)

neural_process = get_neural_process()
params = neural_process.init(key, x_context=data.x, y_context=data.y, x_target=data.x)
```

The neural process takes a decoder and a set of two latent encoders as arguments. All of these are typically MLPs, but
Ramsey is flexible enough that you can change them, for instance, to CNNs or RNNs. Once the model is defined, you can initialize
its parameters just like in Flax.

## Installation

To install from PyPI, call:

```bash
pip install ramsey
```

To install the latest GitHub <RELEASE>, just call the following on the
command line:

```bash
pip install git+https://github.com/ramsey-devs/ramsey@<RELEASE>
```

See also the installation instructions for [JAX](https://github.com/google/jax), if
you plan to use Ramsey on GPU/TPU.

## Contributing

Contributions in the form of pull requests are more than welcome. A good way to start is to check out issues labelled
["good first issue"](https://github.com/ramsey-devs/ramsey/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22).

In order to contribute:

1) Install Ramsey and dev dependencies via `pip install -e '.[dev]'`,
2) test your contribution/implementation by calling `tox` on the (Unix) command line before submitting a PR.

## Why Ramsey

Just as the names of other probabilistic languages are inspired by researchers in the field
(e.g., Stan, Edward, Turing), Ramsey takes its name from one of my favourite philosophers/mathematicians, [Frank Ramsey](https://plato.stanford.edu/entries/ramsey/).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ramsey-devs/ramsey",
    "name": "ramsey",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "bayes,jax,probabilistic deep learning,probabilistic models,neural process",
    "author": "The Ramsey developers",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/d6/ae/5af0d04a5056414d740af55c43062818c6e3bcf296f46af13d26f05ab7e7/ramsey-0.2.1.tar.gz",
    "platform": null,
    "description": "# Ramsey\n\n[![status](http://www.repostatus.org/badges/latest/concept.svg)](http://www.repostatus.org/#concept)\n[![ci](https://github.com/dirmeier/ramsey/actions/workflows/ci.yaml/badge.svg)](https://github.com/dirmeier/ramsey/actions/workflows/ci.yaml)\n[![codecov](https://codecov.io/gh/ramsey-devs/ramsey/branch/main/graph/badge.svg?token=dn1xNBSalZ)](https://codecov.io/gh/ramsey-devs/ramsey)\n[![codacy](https://app.codacy.com/project/badge/Grade/ed13460537fd4ac099c8534b1d9a0202)](https://www.codacy.com/gh/ramsey-devs/ramsey/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=ramsey-devs/ramsey&amp;utm_campaign=Badge_Grade)\n[![documentation](https://readthedocs.org/projects/ramsey/badge/?version=latest)](https://ramsey.readthedocs.io/en/latest/?badge=latest)\n[![version](https://img.shields.io/pypi/v/ramsey.svg?colorB=black&style=flat)](https://pypi.org/project/ramsey/)\n\n> Probabilistic deep learning using JAX\n\n## About\n\nRamsey is a library for probabilistic modelling using [JAX](https://github.com/google/jax),\n[Flax](https://github.com/google/flax) and [NumPyro](https://github.com/pyro-ppl/numpyro).\nIt offers high quality implementations of neural processes, Gaussian processes, Bayesian time series and state-space models, clustering processes,\nand everything else Bayesian.\n\nRamsey makes use of\n\n- Flax`s module system for models with trainable parameters (such as neural or Gaussian processes),\n- NumPyro for models where parameters are endowed with prior distributions (such as Gaussian processes, Bayesian neural networks, ARMA models)\n\nand is hence aimed at being fully compatible with both of them.\n\n## Example usage\n\nYou can, for instance, construct a simple neural process like this:\n\n```python\nfrom jax import random as jr\n\nfrom ramsey import NP\nfrom ramsey.nn import MLP\nfrom ramsey.data import sample_from_sine_function\n\ndef get_neural_process():\n    dim = 128\n    np = NP(\n        decoder=MLP([dim] * 3 + [2]),\n        latent_encoder=(\n            MLP([dim] * 3), MLP([dim, dim * 2])\n        )\n    )\n    return np\n\nkey = jr.PRNGKey(23)\ndata = sample_from_sine_function(key)\n\nneural_process = get_neural_process()\nparams = neural_process.init(key, x_context=data.x, y_context=data.y, x_target=data.x)\n```\n\nThe neural process takes a decoder and a set of two latent encoders as arguments. All of these are typically MLPs, but\nRamsey is flexible enough that you can change them, for instance, to CNNs or RNNs. Once the model is defined, you can initialize\nits parameters just like in Flax.\n\n## Installation\n\nTo install from PyPI, call:\n\n```bash\npip install ramsey\n```\n\nTo install the latest GitHub <RELEASE>, just call the following on the\ncommand line:\n\n```bash\npip install git+https://github.com/ramsey-devs/ramsey@<RELEASE>\n```\n\nSee also the installation instructions for [JAX](https://github.com/google/jax), if\nyou plan to use Ramsey on GPU/TPU.\n\n## Contributing\n\nContributions in the form of pull requests are more than welcome. A good way to start is to check out issues labelled\n[\"good first issue\"](https://github.com/ramsey-devs/ramsey/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22).\n\nIn order to contribute:\n\n1) Install Ramsey and dev dependencies via `pip install -e '.[dev]'`,\n2) test your contribution/implementation by calling `tox` on the (Unix) command line before submitting a PR.\n\n## Why Ramsey\n\nJust as the names of other probabilistic languages are inspired by researchers in the field\n(e.g., Stan, Edward, Turing), Ramsey takes its name from one of my favourite philosophers/mathematicians, [Frank Ramsey](https://plato.stanford.edu/entries/ramsey/).\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "Probabilistic deep learning using JAX",
    "version": "0.2.1",
    "project_urls": {
        "Homepage": "https://github.com/ramsey-devs/ramsey"
    },
    "split_keywords": [
        "bayes",
        "jax",
        "probabilistic deep learning",
        "probabilistic models",
        "neural process"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "55bae98c1a2e591055eae554baa72df0b43d54b53801586034d3a43bbf0b9fe8",
                "md5": "20815278656316ab9f151538598fc202",
                "sha256": "8239eb87cea9f3f218fcdb9507256c66cce184082025188fc1ef94ca3d2c4d82"
            },
            "downloads": -1,
            "filename": "ramsey-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "20815278656316ab9f151538598fc202",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 43390,
            "upload_time": "2023-10-23T12:51:20",
            "upload_time_iso_8601": "2023-10-23T12:51:20.520046Z",
            "url": "https://files.pythonhosted.org/packages/55/ba/e98c1a2e591055eae554baa72df0b43d54b53801586034d3a43bbf0b9fe8/ramsey-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d6ae5af0d04a5056414d740af55c43062818c6e3bcf296f46af13d26f05ab7e7",
                "md5": "ec3394d223a4f1aa6ff2e4658e0d8a53",
                "sha256": "425970e1d2f4dcd794bd7b062f96109bf59076b210426ca2d1c62ee372535f09"
            },
            "downloads": -1,
            "filename": "ramsey-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "ec3394d223a4f1aa6ff2e4658e0d8a53",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 31266,
            "upload_time": "2023-10-23T12:51:21",
            "upload_time_iso_8601": "2023-10-23T12:51:21.981312Z",
            "url": "https://files.pythonhosted.org/packages/d6/ae/5af0d04a5056414d740af55c43062818c6e3bcf296f46af13d26f05ab7e7/ramsey-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-23 12:51:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ramsey-devs",
    "github_project": "ramsey",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "ramsey"
}
        
Elapsed time: 0.28028s