kb1dds / Pysheaf
Labels
Projects that are alternatives of or similar to Pysheaf
PySheaf: Sheaf-theoretic toolbox
This repository consists of Python 3.6 libraries for manipulating cell complexes and sheaves of sets or vector spaces on cell complexes [1], [2], [3], [4], [5], [6]
Documentation:
Full (very out-of-date) documentation for PySheaf verson v0.xx is at <http://kb1dds.github.io/pysheaf/>
_
Right now, the best strategy is to look at the example code!
Download:
You can install by cloning this repo (there is no PyPI package). For Linux, you can do::
$ git clone https://github.com/kb1dds/pysheaf.git $ pip install pysheaf
See the documentation <http://kb1dds.github.io/pysheaf/install.html>
_ for full details! (Though it's a bit out of date...)
Usage:
The general plan of usage is
-
First (usually on paper!) lay out the cell complex that will serve as the base for your sheaf. Give each cell a unique label.
-
Determine all of the stalks over each cell, and the restriction maps. Restriction maps can be a mixture of
numpy
matrices or arbitrary single-input Python function objects. -
Construct a
Sheaf
instance and add each of your cells asCell
instances with theSheaf.AddCell
method. Make sure to use your unique label for eachCell
, because that is how PySheaf identifies them! Once you've done that, create each restriction as aCoface
instance and add it to the sheaf using theSheaf.AddCoface
method. TheSheaf.AddCoface
method will connect the listedCell
s based on their labels.Cell
s andCoface
s can be added later if you want, and they can be added in any order provided anyCoface
refers toCell
s that already exist. -
Install some data into the sheaf by way of an
Assignment
to some of theCell
s. -
Analyze the sheaf and its data: a. You can compute consistency radius with
Sheaf.ComputeConsistencyRadius()
b. You can improve the consistency radius by extending or altering the values of the assignment withSheaf.FuseAssignment()
. This will only alter Cells whoseCell.mOptimizationCell
attribute isTrue
. You can also change the optimization algorithm if you want. c. You can find all star open sets whose local consistency is less than a desired bound usingSheaf.CellIndexesLessThanConsistencyThreshold()
.
Have a look at the example code for some ideas!
This code is under active development, so not everything works as it should. If you find anything that you can correct, feel free to send me suggestions!
| Thanks! | Michael Robinson | American University | [email protected] | [email protected]
.. [1] http://www.drmichaelrobinson.net/sheaftutorial/index.html
.. [2] https://www.youtube.com/user/drmichaelrobinson
.. [3] Cliff Joslyn, Emilie Hogan, Michael Robinson, "Towards a topological framework for integrating semantic information sources," Semantic Technologies for Intelligence, Defense, and Security (STIDS), 2014. http://ceur-ws.org/Vol-1304/STIDS2014_P2_JoslynEtAl.pdf
.. [4] Michael Robinson, "Sheaves are the canonical datastructure for information integration," Information Fusion, 36 (2017), pp. 208-224. (preprint version is http://arxiv.org/abs/1603.01446)
.. [5] Michael Robinson, "Sheaf and cosheaf methods for analyzing multi-model systems," http://arXiv.org/abs/1604.04647
.. [6] Michael Robinson, Topological Signal Processing, Springer, 2014.