Skip to content

Commit ce013ec

Browse files
committed
try without tutorials
1 parent afa8880 commit ce013ec

File tree

3 files changed

+28
-23
lines changed

3 files changed

+28
-23
lines changed

autointent/metrics/scoring.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@ def scoring_log_likelihood(labels: LABELS_VALUE_TYPE, scores: SCORES_VALUE_TYPE,
3838
3939
.. math::
4040
41-
\\frac{1}{\\ell}\\sum_{i=1}^{\\ell}\\log(s[y[i]])
41+
\frac{1}{\ell}\sum_{i=1}^{\ell}\log(s[y[i]])
4242
43-
where ``s[y[i]]`` is a predicted score of ``i``\\ th utterance having ground truth label
43+
where ``s[y[i]]`` is a predicted score of ``i``th utterance having ground truth label
4444
4545
Multilabel case
4646
Mean negative binary cross-entropy:
4747
4848
.. math::
4949
50-
\\frac{1}{\\ell}\\sum_{i=1}^\\ell\\sum_{c=1}^C\\Big[y[i,c]\\cdot\\log(s[i,c])+(1-y[i,c])\\cdot\\log(1-s[i,c])\\Big]
50+
\frac{1}{\ell}\sum_{i=1}^\ell\sum_{c=1}^C\Big[y[i,c]\cdot\log(s[i,c])+(1-y[i,c])\cdot\log(1-s[i,c])\Big]
5151
52-
where ``s[i,c]`` is a predicted score of ``i``\\ th utterance having ground truth label ``c``
52+
where ``s[i,c]`` is a predicted score of ``i``'th utterance having ground truth label ``c``
5353
5454
:param labels: ground truth labels for each utterance
5555
:param scores: for each utterance, this list contains scores for each of `n_classes` classes
@@ -82,7 +82,7 @@ def scoring_roc_auc(labels: LABELS_VALUE_TYPE, scores: SCORES_VALUE_TYPE) -> flo
8282
8383
.. math::
8484
85-
\frac{1}{C}\\sum_{k=1}^C ROCAUC(scores[:, k], labels[:, k])
85+
\frac{1}{C}\sum_{k=1}^C ROCAUC(scores[:, k], labels[:, k])
8686
8787
where ``C`` is the number of classes
8888

docs/source/conf.py

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,19 @@
2727
extensions = [
2828
"sphinx.ext.duration",
2929
"sphinx.ext.autodoc",
30-
"sphinx.ext.doctest",
3130
"sphinx.ext.autosummary",
32-
"nbsphinx",
31+
"sphinx.ext.doctest",
32+
"sphinx.ext.intersphinx",
3333
"sphinx.ext.todo",
34+
"sphinx.ext.coverage",
35+
"sphinx.ext.viewcode",
36+
"sphinx.ext.mathjax",
37+
"sphinx.ext.extlinks",
38+
"sphinx.ext.doctest",
39+
"sphinx.ext.viewcode",
40+
"sphinx_autodoc_typehints",
41+
"sphinx_copybutton",
42+
"nbsphinx",
3443
]
3544

3645
templates_path = ["_templates"]
@@ -51,7 +60,7 @@
5160
"private-members": True,
5261
# "special-members": "__call__",
5362
"member-order": "bysource",
54-
# "exclude-members": "_abc_impl, model_fields, model_computed_fields, model_config",
63+
"exclude-members": "_abc_impl, model_fields, model_computed_fields, model_config",
5564
}
5665

5766
# Finding tutorials directories
@@ -60,15 +69,17 @@
6069
:tutorial_name: {{ env.docname }}
6170
"""
6271

72+
mathjax_path = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
73+
6374

6475
def setup(_) -> None: # noqa: ANN001
65-
generate_tutorial_links_for_notebook_creation(
66-
[
67-
("tutorials.pipeline_optimization", "Pipeline Optimization"),
68-
("tutorials.modules.scoring", "Scoring Modules", [("linear", "Linear Scorer")]),
69-
("tutorials.modules.prediction", "Prediction Modules", [("argmax", "Argmax Predictor")]),
70-
]
71-
)
76+
# generate_tutorial_links_for_notebook_creation(
77+
# [
78+
# ("tutorials.pipeline_optimization", "Pipeline Optimization"),
79+
# ("tutorials.modules.scoring", "Scoring Modules", [("linear", "Linear Scorer")]),
80+
# ("tutorials.modules.prediction", "Prediction Modules", [("argmax", "Argmax Predictor")]),
81+
# ]
82+
# )
7283
regenerate_apiref(
7384
[
7485
("autointent.configs", "Configs"),

docs/source/docs_utils/notebook.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
import nbformat
66
from pydantic import BaseModel
77

8-
try:
9-
from jupytext import jupytext
10-
except ImportError:
11-
jupytext = None
8+
from jupytext import jupytext
129

1310

1411
class ReplacePattern(BaseModel, abc.ABC):
@@ -78,7 +75,7 @@ class DocumentationLink(ReplacePattern):
7875
USAGE EXAMPLES
7976
--------------
8077
81-
%doclink(api,index_pipeline)) -> ../apiref/index_pipeline.rst
78+
%doclink(api,index_pipeline) -> ../apiref/index_pipeline.rst
8279
8380
%doclink(api,script.core.script) -> ../apiref/chatsky.script.core.script.rst
8481
@@ -243,7 +240,4 @@ def py_percent_to_notebook(text: str) -> nbformat.NotebookNode:
243240
# %% [raw]
244241
# This is a raw cell
245242
"""
246-
if jupytext is None:
247-
msg = "`doc` dependencies are not installed."
248-
raise ModuleNotFoundError(msg)
249243
return jupytext.reads(apply_replace_patterns(text), "py:percent")

0 commit comments

Comments
 (0)