banded-matrices


Namebanded-matrices JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://github.com/secondmind-labs/banded_matrices
SummaryNative (C++) implementation of Banded Matrices for TensorFlow
upload_time2024-07-04 12:49:54
maintainerNone
docs_urlNone
authorBanded matrices contributors
requires_python<3.12,>=3.7
licenseApache-2.0
keywords banded matrices linear algebra
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Banded Matrices

## Overview

A library providing C++ linear algebra operators (matmul, solve, ...) dedicated to banded matrices and a [TensorFlow](https://www.tensorflow.org/) interface.
This extends the set of existing TensorFlow operators which as of August 2021 only include `banded_triangular_solve`.

Details on the implemented operators may be found in Durrande et al.:
"[Banded Matrix Operators for Gaussian Markov Models in the Automatic Differentiation Era](http://proceedings.mlr.press/v89/durrande19a.html)", and in Adam et al.: "[Doubly Sparse Variational Gaussian Processes](http://proceedings.mlr.press/v108/adam20a.html)" 


## Installation

### For users

To install the latest (stable) release of the toolbox from [PyPI](https://pypi.org/), use `pip`:
```bash
$ pip install banded_matrices
```

### For contributors

This project uses [Poetry](https://python-poetry.org/docs) to
manage dependencies in a local virtual environment. To install Poetry, [follow the
instructions in the Poetry documentation](https://python-poetry.org/docs/#installation).

To install this project in editable mode, run the commands below from the root directory of the
`banded_matrices` repository.

```bash
poetry install
```

This command creates a virtual environment for this project
in a hidden `.venv` directory under the root directory.

You must also run the `poetry install` command to install updated dependencies when
the `pyproject.toml` file is updated, for example after a `git pull`.

**NOTE:** Unlike most other Python packages, by installing the `banded_matrices` package
from source you will trigger a compilation of the C++ TensorFlow ops library. This means that
running `poetry install` can take a while - in the order of 5 minutes, depending on the machine
you are installing onto.
  
#### Known issues

Poetry versions above `1.0.9` don't get along (for now) with Ubuntu 18.04, if you have this OS, 
you will likely need to install version `1.0.9`. This can be done with the following command

```bash
wget https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py
POETRY_VERSION=1.0.9 python get-poetry.py 
```

Recommended Poetry installation might pick up Python 2 if it is used by the operating system, 
this will cause problems with looking up libraries and sorting out dependencies if your 
library uses Python 3. If this happens, poetry has a command you can use to instruct it to use 
a correct Python version (here assuming you want to use python3.7 and have it installed on your 
system - note that `python3.7-venv` package will need to be installed as well). 

```bash
poetry env use python3.7 && poetry install
```

The `poetry install` command might fail to install certain Python packages 
(those that use the 'manylinux2010' platform tag), if the version of
`pip` installed when creating the Poetry virtual environment is too old.
Unfortunately the version of `pip` used when creating the virtual environment is vendored with each
Python version, and it is not possible to update this.

The solution is to update the version of `pip` in the Poetry virtual environment after the initial
install fails, and then reattempt the installation. To do this, use the command:

```bash
poetry install || { poetry run pip install -U pip==20.0.2 && poetry install; }
```

## Running the tests

Run these commands from the root directory of this repository. 
To run the full Python test suite, including pylint and Mypy, run: 

```bash
poetry run task test
```

Alternatively, you can run just the unit tests, starting with the failing tests and exiting after
the first test failure:

```bash
poetry run task quicktest
```

To run linting of the C++ code (using cpplint), run:

```bash
poetry run task cpplint
```

**NOTE:** Running the tests requires
that the project virtual environment has been updated. See [Installation](#Installation).

## The Secondmind Labs Community

### Getting help

**Bugs, feature requests, pain points, annoying design quirks, etc:**
Please use [GitHub issues](https://github.com/secondmind-labs/banded_matrices/issues/) to flag up bugs/issues/pain points, suggest new features, and discuss anything else related to the use of banded_matrices that in some sense involves changing the banded_matrices code itself. We positively welcome comments or concerns about usability, and suggestions for changes at any level of design. We aim to respond to issues promptly, but if you believe we may have forgotten about an issue, please feel free to add another comment to remind us.

### Slack workspace

We have a public [Secondmind Labs slack workspace](https://secondmind-labs.slack.com/). Please use this [invite link](https://join.slack.com/t/secondmind-labs/shared_invite/zt-ph07nuie-gMlkle__tjvXBay4FNSLkw) and join the #banded_matrices channel, whether you'd just like to ask short informal questions or want to be involved in the discussion and future development of banded_matrices.


### Contributing

All constructive input is very much welcome. For detailed information, see the [guidelines for contributors](CONTRIBUTING.md).


### Maintainers

Banded_matrices was originally created at [Secondmind Labs](https://www.secondmind.ai/labs/) and is now maintained by (in alphabetical order)
[Vincent Adam](https://vincentadam87.github.io/),
[Artem Artemev](https://github.com/awav/).
**We are grateful to [all contributors](CONTRIBUTORS.md) who have helped shape banded_matrices.**

Banded_matrices is an open source project. If you have relevant skills and are interested in contributing then please do contact us (see ["The Secondmind Labs Community" section](#the-secondmind-labs-community) above).

We are very grateful to our Secondmind Labs colleagues, maintainers of [GPflow](https://github.com/GPflow/GPflow), [GPflux](https://github.com/secondmind-labs/GPflux), [Trieste](https://github.com/secondmind-labs/trieste) and [Bellman](https://github.com/Bellman-devs/bellman), for their help with creating contributing guidelines, instructions for users and open-sourcing in general.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/secondmind-labs/banded_matrices",
    "name": "banded-matrices",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.12,>=3.7",
    "maintainer_email": null,
    "keywords": "banded matrices, linear algebra",
    "author": "Banded matrices contributors",
    "author_email": "labs@secondmind.ai",
    "download_url": "https://files.pythonhosted.org/packages/23/dd/6873f8840218d12bf0f6fd057281bde104f368ee92c2faf1b9dbd3b317d5/banded_matrices-0.1.3.tar.gz",
    "platform": null,
    "description": "# Banded Matrices\n\n## Overview\n\nA library providing C++ linear algebra operators (matmul, solve, ...) dedicated to banded matrices and a [TensorFlow](https://www.tensorflow.org/) interface.\nThis extends the set of existing TensorFlow operators which as of August 2021 only include `banded_triangular_solve`.\n\nDetails on the implemented operators may be found in Durrande et al.:\n\"[Banded Matrix Operators for Gaussian Markov Models in the Automatic Differentiation Era](http://proceedings.mlr.press/v89/durrande19a.html)\", and in Adam et al.: \"[Doubly Sparse Variational Gaussian Processes](http://proceedings.mlr.press/v108/adam20a.html)\" \n\n\n## Installation\n\n### For users\n\nTo install the latest (stable) release of the toolbox from [PyPI](https://pypi.org/), use `pip`:\n```bash\n$ pip install banded_matrices\n```\n\n### For contributors\n\nThis project uses [Poetry](https://python-poetry.org/docs) to\nmanage dependencies in a local virtual environment. To install Poetry, [follow the\ninstructions in the Poetry documentation](https://python-poetry.org/docs/#installation).\n\nTo install this project in editable mode, run the commands below from the root directory of the\n`banded_matrices` repository.\n\n```bash\npoetry install\n```\n\nThis command creates a virtual environment for this project\nin a hidden `.venv` directory under the root directory.\n\nYou must also run the `poetry install` command to install updated dependencies when\nthe `pyproject.toml` file is updated, for example after a `git pull`.\n\n**NOTE:** Unlike most other Python packages, by installing the `banded_matrices` package\nfrom source you will trigger a compilation of the C++ TensorFlow ops library. This means that\nrunning `poetry install` can take a while - in the order of 5 minutes, depending on the machine\nyou are installing onto.\n  \n#### Known issues\n\nPoetry versions above `1.0.9` don't get along (for now) with Ubuntu 18.04, if you have this OS, \nyou will likely need to install version `1.0.9`. This can be done with the following command\n\n```bash\nwget https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py\nPOETRY_VERSION=1.0.9 python get-poetry.py \n```\n\nRecommended Poetry installation might pick up Python 2 if it is used by the operating system, \nthis will cause problems with looking up libraries and sorting out dependencies if your \nlibrary uses Python 3. If this happens, poetry has a command you can use to instruct it to use \na correct Python version (here assuming you want to use python3.7 and have it installed on your \nsystem - note that `python3.7-venv` package will need to be installed as well). \n\n```bash\npoetry env use python3.7 && poetry install\n```\n\nThe `poetry install` command might fail to install certain Python packages \n(those that use the 'manylinux2010' platform tag), if the version of\n`pip` installed when creating the Poetry virtual environment is too old.\nUnfortunately the version of `pip` used when creating the virtual environment is vendored with each\nPython version, and it is not possible to update this.\n\nThe solution is to update the version of `pip` in the Poetry virtual environment after the initial\ninstall fails, and then reattempt the installation. To do this, use the command:\n\n```bash\npoetry install || { poetry run pip install -U pip==20.0.2 && poetry install; }\n```\n\n## Running the tests\n\nRun these commands from the root directory of this repository. \nTo run the full Python test suite, including pylint and Mypy, run: \n\n```bash\npoetry run task test\n```\n\nAlternatively, you can run just the unit tests, starting with the failing tests and exiting after\nthe first test failure:\n\n```bash\npoetry run task quicktest\n```\n\nTo run linting of the C++ code (using cpplint), run:\n\n```bash\npoetry run task cpplint\n```\n\n**NOTE:** Running the tests requires\nthat the project virtual environment has been updated. See [Installation](#Installation).\n\n## The Secondmind Labs Community\n\n### Getting help\n\n**Bugs, feature requests, pain points, annoying design quirks, etc:**\nPlease use [GitHub issues](https://github.com/secondmind-labs/banded_matrices/issues/) to flag up bugs/issues/pain points, suggest new features, and discuss anything else related to the use of banded_matrices that in some sense involves changing the banded_matrices code itself. We positively welcome comments or concerns about usability, and suggestions for changes at any level of design. We aim to respond to issues promptly, but if you believe we may have forgotten about an issue, please feel free to add another comment to remind us.\n\n### Slack workspace\n\nWe have a public [Secondmind Labs slack workspace](https://secondmind-labs.slack.com/). Please use this [invite link](https://join.slack.com/t/secondmind-labs/shared_invite/zt-ph07nuie-gMlkle__tjvXBay4FNSLkw) and join the #banded_matrices channel, whether you'd just like to ask short informal questions or want to be involved in the discussion and future development of banded_matrices.\n\n\n### Contributing\n\nAll constructive input is very much welcome. For detailed information, see the [guidelines for contributors](CONTRIBUTING.md).\n\n\n### Maintainers\n\nBanded_matrices was originally created at [Secondmind Labs](https://www.secondmind.ai/labs/) and is now maintained by (in alphabetical order)\n[Vincent Adam](https://vincentadam87.github.io/),\n[Artem Artemev](https://github.com/awav/).\n**We are grateful to [all contributors](CONTRIBUTORS.md) who have helped shape banded_matrices.**\n\nBanded_matrices is an open source project. If you have relevant skills and are interested in contributing then please do contact us (see [\"The Secondmind Labs Community\" section](#the-secondmind-labs-community) above).\n\nWe are very grateful to our Secondmind Labs colleagues, maintainers of [GPflow](https://github.com/GPflow/GPflow), [GPflux](https://github.com/secondmind-labs/GPflux), [Trieste](https://github.com/secondmind-labs/trieste) and [Bellman](https://github.com/Bellman-devs/bellman), for their help with creating contributing guidelines, instructions for users and open-sourcing in general.\n\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Native (C++) implementation of Banded Matrices for TensorFlow",
    "version": "0.1.3",
    "project_urls": {
        "Homepage": "https://github.com/secondmind-labs/banded_matrices",
        "Repository": "https://github.com/secondmind-labs/banded_matrices"
    },
    "split_keywords": [
        "banded matrices",
        " linear algebra"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "694f063365cee8efb9c8db59d4fd8d99dfb368c3e3307d48d59f24c7811b5f68",
                "md5": "cd11c4481b2d56680221e754e49e8313",
                "sha256": "30beda3d08e81519b78d6802446718925116b3547491ed256d7b2aaa1e2d894d"
            },
            "downloads": -1,
            "filename": "banded_matrices-0.1.3-cp38-cp38-manylinux_2_35_x86_64.whl",
            "has_sig": false,
            "md5_digest": "cd11c4481b2d56680221e754e49e8313",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": "<3.12,>=3.7",
            "size": 94901,
            "upload_time": "2024-07-04T12:49:55",
            "upload_time_iso_8601": "2024-07-04T12:49:55.277453Z",
            "url": "https://files.pythonhosted.org/packages/69/4f/063365cee8efb9c8db59d4fd8d99dfb368c3e3307d48d59f24c7811b5f68/banded_matrices-0.1.3-cp38-cp38-manylinux_2_35_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "80060f89d7f263235dc3c5acc414a60df178287b4542576654aead4c41c5c038",
                "md5": "4a76ec496fd3aa0bfc787872961eaa92",
                "sha256": "169c0db5f32c940f27fef7b1256e95e85f2f8f47e435685c8c995a4f857f106a"
            },
            "downloads": -1,
            "filename": "banded_matrices-0.1.3-cp39-cp39-manylinux_2_35_x86_64.whl",
            "has_sig": false,
            "md5_digest": "4a76ec496fd3aa0bfc787872961eaa92",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": "<3.12,>=3.7",
            "size": 94901,
            "upload_time": "2024-07-04T12:49:53",
            "upload_time_iso_8601": "2024-07-04T12:49:53.513901Z",
            "url": "https://files.pythonhosted.org/packages/80/06/0f89d7f263235dc3c5acc414a60df178287b4542576654aead4c41c5c038/banded_matrices-0.1.3-cp39-cp39-manylinux_2_35_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "23dd6873f8840218d12bf0f6fd057281bde104f368ee92c2faf1b9dbd3b317d5",
                "md5": "19ae2a69a30873ef40038317341b24d6",
                "sha256": "51701b9e0ea56807556c17f5a770c249326fd70c86468d899a7a271d4122e792"
            },
            "downloads": -1,
            "filename": "banded_matrices-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "19ae2a69a30873ef40038317341b24d6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.12,>=3.7",
            "size": 67248,
            "upload_time": "2024-07-04T12:49:54",
            "upload_time_iso_8601": "2024-07-04T12:49:54.624104Z",
            "url": "https://files.pythonhosted.org/packages/23/dd/6873f8840218d12bf0f6fd057281bde104f368ee92c2faf1b9dbd3b317d5/banded_matrices-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-04 12:49:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "secondmind-labs",
    "github_project": "banded_matrices",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "banded-matrices"
}
        
Elapsed time: 3.78054s