Skip to content

Commit

Permalink
doc: Added basic documentation for the new experiments module
Browse files Browse the repository at this point in the history
  • Loading branch information
bpiwowar committed Dec 8, 2023
1 parent d828428 commit 529ca63
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
61 changes: 61 additions & 0 deletions docs/source/experiments.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Running IR experiments
----------------------

The module `xpmir.experiments` contain code factorizing boilerplate for launching experiments

For instance, one can define a standard IR experiments that learns (with tensorboard),
evaluates a model on a different metrics and upload it to HuggingFace.


Example
=======

An `experiment.py` file:

.. code-block:: py3
from xpmir.experiments.ir import PaperResults, ir_experiment, ExperimentHelper
from xpmir.papers import configuration
@configuration
class Configuration:
#: Default learning rate
learning_rate: float = 1e-3
@ir_experiment()
def run(
helper: ExperimentHelper, cfg: Configuration
) -> PaperResults:
...
return PaperResults(
models={"my-model@RR10": outputs.listeners[validation.id]["RR@10"]},
evaluations=tests,
tb_logs={"my-model@RR10": learner.logpath},
)
With `full.yaml` located in the same folder as `experiment.py`

.. code-block:: yaml
file: experiment
learning_rate: 1e-4
The experiment can be started with

.. code-block: sh
xpmir run-experiment --run-mode normal full.yaml
Common handling
===============

.. automodule:: xpmir.experiments.cli
:members:

IR experiment
=============

.. automodule:: xpmir.experiments.ir
:members:
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Table of Contents
neural
hooks
text/index
experiments
papers/index
pretrained

Expand Down

0 comments on commit 529ca63

Please sign in to comment.