Package: geomstats
GeomstatsCodeContinuous IntegrationCode coverage (np, autograd, torch)DocumentationCommunityNEWS:The white papers summarizing the findings from our ICLR 2021 and 2022 challenges of computational differential geometry and topology are availablehere (2021)andhere (2022).Check out our newinformation_geometrymodule.Geomstats is an open-source Python package for computations and
statistics on manifolds. The package is organized into two main modules:geometryandlearning.The modulegeometryimplements concepts in differential geometry,
and the modulelearningimplements statistics and learning
algorithms for data on manifolds.To get an overview ofgeomstats, see ourintroductory
video.To understand howgeomstatsis built, check outthese slides.To get started withgeomstats, see theexamplesandnotebooksdirectories.The documentation ofgeomstatscan be found on thedocumentation
website.Interested in information geometry? Go to ourinformation_geometrymodule.To follow the scientific literature on geometric statistics, follow
our twitter-bot@geomstats!Keep in touch with the community by joining us on ourslack workspace!Citing GeomstatsIf you findgeomstatsuseful, please kindly cite:our researchpaper:@article{JMLR:v21:19-027,
  author  = {Nina Miolane and Nicolas Guigui and Alice Le Brigant and Johan Mathe and Benjamin Hou and Yann Thanwerdas and Stefan Heyder and Olivier Peltre and Niklas Koep and Hadi Zaatiti and Hatem Hajri and Yann Cabanes and Thomas Gerald and Paul Chauchat and Christian Shewmake and Daniel Brooks and Bernhard Kainz and Claire Donnat and Susan Holmes and Xavier Pennec},
  title   = {Geomstats:  A Python Package for Riemannian Geometry in Machine Learning},
  journal = {Journal of Machine Learning Research},
  year    = {2020},
  volume  = {21},
  number  = {223},
  pages   = {1-9},
  url     = {http://jmlr.org/papers/v21/19-027.html}
}andGeomstats software version(citation automatically generated by Zenodo at the bottom right of this link).We would sincerely appreciate citations to both the original research paper and the software version, to acknowledge authors who started the codebase and made the library possible, together with the crucial work of all contributors who are continuously implementing pivotal new geometries and important learning algorithms, as well as refactoring, testing and documenting the code to democratize geometric statistics and (deep) learning and foster reproducible research in this field.Install geomstats via pip3From a terminal (OS X & Linux), you can install geomstats and its
requirements withpip3as follows:pip3 install geomstatsThis method installs the latest version of geomstats that is uploaded on
PyPi. Note that geomstats is only available with Python3.Install geomstats via condaFrom a terminal (OS X & Linux) or an Anaconda prompt (Windows), you can install geomstats and its
requirements withcondaas follows:conda install -c conda-forge geomstatsThis method installs the latest version of geomstats that is uploaded on
conda-forge. Note that geomstats is only available with Python3.Install geomstats via GitFrom a terminal (OS X & Linux), you can install geomstats and its
requirements viagitas follows:git clone https://github.com/geomstats/geomstats.git
cd geomstats
pip3 install .This method installs the latest GitHub version of geomstats.Note that this only installs the minimum requirements. To add the optional,
development, continuous integration and documentation requirements,
refer to the filepyproject.toml.Install geomstats : DevelopersDevelopers should git clone the master branch of this repository, together with the development requirements
and the optional requirements to enableautogradandpytorchbackends:pip3 install geomstats[dev,opt]Additionally, we recommend installing our pre-commit hook, to ensure that your code
follows our Python style guidelines:pre-commit installChoose the backendGeomstats can run seamlessly withnumpy,autogradorpytorch. Note thatautogradandpytorchand requirements are
optional, as geomstats can be used withnumpyonly. By default, thenumpybackend is used. The visualizations are only available with
this backend.To get theautogradandpytorchversions compatible with
geomstats, install the optional requirements:pip3 install geomstats[opt]To install only the requirements for a given backend do:pip3 install geomstats[<backend_name>]You can choose your backend by setting the environment variableGEOMSTATS_BACKENDtonumpy,autogradorpytorch, and
importing thebackendmodule. From the command line:export GEOMSTATS_BACKEND=<backend_name>and in the Python3 code:import geomstats.backend as gsGetting startedTo usegeomstatsfor learning algorithms on Riemannian manifolds,
you need to follow three steps:instantiate the manifold of interest,instantiate the learning algorithm of interest,run the algorithm.The data should be represented by ags.array. This structure
represents numpy arrays, autograd or pytorch tensors, depending on the
choice of backend.The following code snippet shows the use of tangent Principal Component
Analysis on simulateddataon the space of 3D rotations.fromgeomstats.geometry.special_orthogonalimportSpecialOrthogonalfromgeomstats.learning.pcaimportTangentPCAso3=SpecialOrthogonal(n=3,point_type="vector")metric=so3.bi_invariant_metricdata=so3.random_uniform(n_samples=10)tpca=TangentPCA(metric=metric,n_components=2)tpca=tpca.fit(data)tangent_projected_data=tpca.transform(data)All geometric computations are performed behind the scenes. The user
only needs a high-level understanding of Riemannian geometry. Each
algorithm can be used with any of the manifolds and metric implemented
in the package.To see additional examples, go to theexamplesornotebooksdirectories.ContributingSee ourcontributingguidelines!Interested? Contact us and join the next hackathons. Previous Geomstats events include:January 2020: hackathon at Inria Sophia-Antipolis, Nice, FranceApril 2020: remote online hackathonMarch - April 2021: hackathon, hybrid at Inria Sophia-Antipolis / remotely with contributors from around the worldJuly 2021: hackathon at the Geometric Science of Information (GSI) conference, Paris, FranceAugust 2021: international Coding Challenge at the International Conference on Learning Representations (ICLR), remotelyDecember 2021: fixit hackathon at the Sorbonne Center for Artificial Intelligence, Paris, France.February 2022: hackathon, hybrid at Inria Sophia-Antipolis / remotely with contributors from around the worldApril 2022: in-person hackathon at the Villa Cynthia, Saint Raphael, France.April 2022: international Coding Challenge at the International Conference on Learning Representations (ICLR), remotely.June 2022: hakathon at the University of Washington (UW).October 17-21, 2022: hackathon during the trimesterGeometry and Statistics in Data Sciences, in Paris.AcknowledgementsThis work is supported by:the Inria-Stanford associated teamGeomStats,the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation program (grant agreementG-StatisticsNo. 786854),the French society for applied and industrial mathematics (SMAI),the National Science Foundation (grant NSF DMS RTG 1501767).