There are two documentation plugins, one for for Sphinx (recommended) and mkdocs (deprecated).


Just configure Sphinx to use the experimaestro.sphinx extension.

Sphinx allows to link documentations (through the extension sphinx.ext.intersphinx).

You can then use the directive ::autoxpmconfig QUALITIFIED_CLASSNAME (which extends autoclass) to build the documentation of a configuration or class.


An example configuration

  - experimaestro:
      # Allows to cope with uninstalled modules when generating documentation
      - mymodule.mkdocs_init
      # Learning to rank modul
      - mymodule.letor:
      # Neural module
      - mymodule.neural:
      # All the rest
      - mymodule:
      # Maps datatype
      - datamaestro: ""

Including methods

class CSV:
    def data(self) -> Tuple[List[str], "numpy.array"]:
        """Returns the list of fields and the numeric data as a Numpy array

        Returns: List of fields

Writing subpackage documentation

It is possible to write a structured documentation

title: Learning to rank

# Learning to rank

## Scores

Scorers are able to give a score to a (query, document) pair. Among the
scorers, some are have learnable parameters.


## Trainers

Trainers are responsible for defining the loss (given a learnable scorer)


## Sampler

How to sample learning batches.


Some tricks

Avoiding to load some modules

When building the documentation, it might be useful not to have to install all the dependencies.

import re
from experimaestro.mkdocs.metaloader import DependencyInjectorFinder