![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
|Travis-CI-badge| |Readthedocs-badge|
sparsegrad
automatically and efficiently calculates analytical sparse Jacobian of arbitrary numpy
vector valued functions. It is designed to be useful for solving large systems of non-linear equations. sparsegrad
is memory efficient because it does not use the graph of computation. Arbitrary computations are supported through indexing, matrix multiplication, branching, and custom functions.
Taking Jacobian with respect to variable x
is done by replacing numerical value of x
with sparsegrad seed
.. code:: python
>>> import numpy as np
>>> import sparsegrad.forward as ad
>>> def f(x):
... return x-x[::-1]
>>> x=np.linspace(0,1,3)
>>> print(f(ad.seed(x)).dvalue)
(0, 0) 1.0
(0, 2) -1.0
(2, 0) -1.0
(2, 2) 1.0
sparsegrad
is written in pure Python. For easy installation and best portability, it does not contain extension modules. In realistic problems, it can provide similar or better performance than ADOL-C best case of repeated calculation
. This is possible thanks to algorithmic optimizations and optimizations to avoid slow parts of scipy.sparse
.
sparsegrad
relies on numpy
and scipy
for computations. It is compatible with both Python 2.7 and 3.x.
.. code:: bash
pip install sparsegrad
It is recommended to run test suite after installing
.. code:: bash
python -c "import sparsegrad; sparsegrad.test()"
.. |Travis-CI-badge| image:: https://travis-ci.org/mzszym/sparsegrad.svg?branch=master :target: https://travis-ci.org/mzszym/sparsegrad
.. |Readthedocs-badge| image:: https://readthedocs.org/projects/sparsegrad/badge/?version=latest :target: http://sparsegrad.readthedocs.io/en/latest/?badge=latest
FAQs
fast calculation of sparse gradients and Jacobian matrices in Python
We found that sparsegrad demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.