Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pytest src/metrax
Develop the docs locally:

```
pip install -r ./docs/requirements.txt
sphinx-build ./docs /tmp/metrax_docs
python -m http.server --directory /tmp/metrax_docs
```
24 changes: 22 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,21 @@
"""Configuration file for the Sphinx documentation builder."""

import sphinx_rtd_theme
import os
import sys

# Import local version of metrax.
sys.path.insert(0, os.path.abspath('../src'))
print('DEBUG: PATH', sys.path)

# -- Project information

project = 'metrax'
copyright = '2025, The metrax Authors'
author = 'The metrax Authors'

release = '0.0.2'
version = '0.0.2'
release = ''
version = ''


# -- General configuration
Expand All @@ -34,6 +40,8 @@
'sphinx.ext.intersphinx',
'sphinx.ext.napoleon',
'sphinx_rtd_theme',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
]

intersphinx_mapping = {
Expand All @@ -50,3 +58,15 @@

# -- Options for EPUB output
epub_show_urls = 'footnote'


# -- Extension configuration

autodoc_member_order = 'bysource'

autodoc_default_options = {
'members': None,
'undoc-members': True,
'show-inheritance': True,
'special-members': '__call__, __init__',
}
36 changes: 34 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,38 @@ metrax Documentation

**metrax** provides common evaluation metric implementations for JAX.

.. note::
Getting Started
---------------

This project is under active development.
Metrics are based on `clu.Metric`.

.. code-block::

# Run model:
y_true, y_pred = model(inputs)

# Create metric class:
metric = metrics.Precision.from_model_output(
predictions=y_pred,
labels=y_true,
)

# Update metric with new inputs:
metric = metric.merge(
metrics.Precision.from_model_output(
predictions=y_pred,
labels=y_true,
)
)

# Get result:
result = metric.compute()


Metrax API
==========

.. toctree::
:maxdepth: 2

metrax API <metrax>
4 changes: 4 additions & 0 deletions docs/metrax.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
metrax
======

.. automodule:: metrax
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
sphinx-rtd-theme==1.3.0rc1
clu==0.0.12
scikit-learn==1.6.1