Skip to content

Commit 76e7d76

Browse files
committed
Add documentation
1 parent db387f0 commit 76e7d76

File tree

13 files changed

+222
-1
lines changed

13 files changed

+222
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ __pycache__
44
build
55
dist
66
*.egg-info
7+
docs/_build/

.readthedocs.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Read the Docs configuration file
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the OS, Python version, and other tools you might need
8+
build:
9+
os: ubuntu-24.04
10+
tools:
11+
python: "3.13"
12+
13+
# Build documentation in the "docs/" directory with Sphinx
14+
sphinx:
15+
configuration: docs/conf.py
16+
17+
# Optionally, but recommended,
18+
# declare the Python requirements required to build your documentation
19+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
20+
python:
21+
install:
22+
- requirements: requirements_dev.txt

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![PyPI](https://img.shields.io/pypi/v/tensorflow-riemopt.svg)](https://pypi.org/project/tensorflow-riemopt/)
44
[![arXiv](https://img.shields.io/badge/arXiv-2105.13921-b31b1b.svg)](https://arxiv.org/abs/2105.13921)
55
[![Build Status](https://github.com/master/tensorflow-riemopt/actions/workflows/build.yml/badge.svg)](https://github.com/master/tensorflow-riemopt/actions)
6+
[![Documentation Status](https://readthedocs.org/projects/tensorflow-riemopt/badge/?version=latest)](https://tensorflow-riemopt.readthedocs.io)
67
[![Coverage Status](https://coveralls.io/repos/github/master/tensorflow-riemopt/badge.svg)](https://coveralls.io/github/master/tensorflow-riemopt)
78
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
89
[![License](https://img.shields.io/:license-mit-blue.svg)](https://badges.mit-license.org)

docs/Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Makefile for building the Sphinx documentation
2+
# You can also run sphinx-build directly: sphinx-build -b html . _build/html
3+
4+
# Directory for source files
5+
SOURCEDIR = .
6+
# Directory for build output
7+
BUILDDIR = _build
8+
9+
.PHONY: help clean html
10+
11+
help:
12+
@echo "Please use 'make <target>' where <target> is one of"
13+
@echo " html to build the HTML documentation"
14+
15+
html:
16+
@sphinx-build -b html $(SOURCEDIR) $(BUILDDIR)/html
17+
18+
clean:
19+
@rm -rf $(BUILDDIR)

docs/api/index.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
API Reference
2+
=============
3+
4+
This section contains the API reference for the `tensorflow_riemopt` package.
5+
6+
.. toctree::
7+
:maxdepth: 2
8+
:titlesonly:
9+
10+
variable
11+
layers
12+
manifolds
13+
optimizers

docs/api/layers.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Layers Package
2+
==============
3+
4+
This package provides manifold-aware neural network layers.
5+
6+
.. automodule:: tensorflow_riemopt.layers
7+
:members:
8+
:undoc-members:
9+
:show-inheritance:

docs/api/manifolds.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Manifolds Package
2+
=================
3+
4+
The module implements a variety of Riemannian manifolds as Python classes. Each manifold class encapsulates core geometric operations, such as distance functions, geodesics, exponential/logarithm maps, projections, and retractions, enabling integration of non-Euclidean geometry into neural network models.
5+
6+
Certain manifolds (e.g., SPD and Stiefel) can be endowed with different Riemannian metrics, resulting in distinct operations implemented in their corresponding classes.
7+
8+
.. automodule:: tensorflow_riemopt.manifolds
9+
10+
.. automodule:: tensorflow_riemopt.manifolds
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:

docs/api/optimizers.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Optimizers Package
2+
==================
3+
4+
The module provides Riemannian optimization algorithms for TensorFlow and its Keras API. These optimizers adapt standard methods to manifold settings by projecting gradients onto tangent spaces, retracting updates back onto the manifold, and optionally using vector transport to handle adaptive schemes.
5+
6+
.. automodule:: tensorflow_riemopt.optimizers
7+
:members:
8+
:undoc-members:
9+
:show-inheritance:

docs/api/variable.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Variable Utilities
2+
==================
3+
4+
Utilities for associating TensorFlow variables with Riemannian manifolds.
5+
6+
.. automodule:: tensorflow_riemopt.variable
7+
:members:
8+
:undoc-members:
9+
:show-inheritance:

docs/conf.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
import os
3+
import sys
4+
5+
# Add project root to sys.path for autodoc
6+
sys.path.insert(0, os.path.abspath('..'))
7+
8+
project = 'tensorflow-riemopt'
9+
author = 'Oleg Smirnov'
10+
# The full version, including alpha/beta/rc tags
11+
release = '0.3.0'
12+
13+
extensions = [
14+
'sphinx.ext.autodoc',
15+
'sphinx.ext.napoleon',
16+
'sphinx.ext.viewcode',
17+
'sphinx.ext.mathjax',
18+
'sphinx_autodoc_typehints',
19+
'myst_parser',
20+
]
21+
22+
templates_path = ['_templates']
23+
# Exclude Jupyter checkpoints
24+
exclude_patterns = ['**.ipynb_checkpoints']
25+
26+
# HTML output
27+
html_title = "tensorflow-riemopt documentation"
28+
html_theme = 'pydata_sphinx_theme'
29+
html_static_path = ['_static']
30+
html_theme_options = {
31+
"primary_sidebar_end": [],
32+
"icon_links": [
33+
{
34+
"name": "GitHub",
35+
"url": "https://github.com/master/tensorflow-riemopt",
36+
"icon": "fa-brands fa-square-github",
37+
"type": "fontawesome",
38+
}
39+
],
40+
"use_edit_page_button": False,
41+
"collapse_navigation": True,
42+
}
43+
html_context = {
44+
"github_user": "master",
45+
"github_repo": "tensorflow-riemopt",
46+
"doc_path": "docs",
47+
"default_mode": "light",
48+
}
49+
50+
# Autodoc settings
51+
autodoc_member_order = 'bysource'
52+
autoclass_content = 'both'
53+
54+
# Source suffix and master doc
55+
source_suffix = {
56+
'.rst': 'restructuredtext',
57+
'.md': 'markdown',
58+
}
59+
master_doc = 'index'

0 commit comments

Comments
 (0)