Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
LegrandNico committed Sep 26, 2024
1 parent 9005921 commit 5bbc745
Show file tree
Hide file tree
Showing 18 changed files with 2,661 additions and 1,773 deletions.
69 changes: 15 additions & 54 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@ Posterior updates

Update the sufficient statistics of a state node after receiving prediction errors from children nodes. The prediction errors from all the children below the node should be computed before calling the posterior update step.

Binary nodes
------------

.. currentmodule:: pyhgf.updates.posterior.binary

.. autosummary::
:toctree: generated/pyhgf.updates.posterior.binary

binary_node_update_posterior_infinite
binary_node_update_posterior_finite


Categorical nodes
-----------------
Expand All @@ -42,7 +31,7 @@ Categorical nodes
.. autosummary::
:toctree: generated/pyhgf.updates.posterior.categorical

categorical_input_update
categorical_state_update

Continuous nodes
----------------
Expand Down Expand Up @@ -109,55 +98,26 @@ Prediction error steps

Compute the value and volatility prediction errors of a given node. The prediction error can only be computed after the posterior update (or observation) of a given node.

Inputs
------

Binary inputs
^^^^^^^^^^^^^

.. currentmodule:: pyhgf.updates.prediction_error.inputs.binary

.. autosummary::
:toctree: generated/pyhgf.updates.prediction_error.inputs.binary

binary_input_prediction_error_infinite_precision
binary_input_prediction_error_finite_precision

Continuous inputs
^^^^^^^^^^^^^^^^^

.. currentmodule:: pyhgf.updates.prediction_error.inputs.continuous

.. autosummary::
:toctree: generated/pyhgf.updates.prediction_error.inputs.continuous

continuous_input_volatility_prediction_error
continuous_input_value_prediction_error
continuous_input_prediction_error

Generic input
^^^^^^^^^^^^^
Binary state nodes
^^^^^^^^^^^^^^^^^^

.. currentmodule:: pyhgf.updates.prediction_error.inputs.generic
.. currentmodule:: pyhgf.updates.prediction_error.binary

.. autosummary::
:toctree: generated/pyhgf.updates.prediction_error.inputs.generic

generic_input_prediction_error

State nodes
-----------
:toctree: generated/pyhgf.updates.prediction_error.binary

binary_state_node_prediction_error
binary_finite_state_node_prediction_error

Binary state nodes
^^^^^^^^^^^^^^^^^^
Categorical state nodes
^^^^^^^^^^^^^^^^^^^^^^^

.. currentmodule:: pyhgf.updates.prediction_error.nodes.binary
.. currentmodule:: pyhgf.updates.prediction_error.categorical

.. autosummary::
:toctree: generated/pyhgf.updates.prediction_error.nodes.binary
:toctree: generated/pyhgf.updates.prediction_error.categorical

binary_state_node_prediction_error
categorical_state_prediction_error

Continuous state nodes
^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -171,8 +131,8 @@ Continuous state nodes
continuous_node_volatility_prediction_error
continuous_node_prediction_error

Dirichlet processes
^^^^^^^^^^^^^^^^^^^
Dirichlet state nodes
^^^^^^^^^^^^^^^^^^^^^

.. currentmodule:: pyhgf.updates.prediction_error.nodes.dirichlet

Expand Down Expand Up @@ -269,6 +229,7 @@ Utilities for manipulating neural networks.
get_update_sequence
to_pandas
add_edges
get_input_idxs

Math
****
Expand Down
63 changes: 59 additions & 4 deletions docs/source/notebooks/0.1-Theory.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
"id": "6e1a2f15-fb23-417c-bf08-95fe8019903d",
"metadata": {
"editable": true,
"execution": {
"iopub.execute_input": "2024-09-26T13:08:54.305535Z",
"iopub.status.busy": "2024-09-26T13:08:54.305204Z",
"iopub.status.idle": "2024-09-26T13:08:54.313050Z",
"shell.execute_reply": "2024-09-26T13:08:54.311747Z"
},
"slideshow": {
"slide_type": ""
},
Expand All @@ -46,7 +52,14 @@
"cell_type": "code",
"execution_count": 2,
"id": "6430ec8b-1b42-450b-9ed5-a9866384042f",
"metadata": {},
"metadata": {
"execution": {
"iopub.execute_input": "2024-09-26T13:08:54.317101Z",
"iopub.status.busy": "2024-09-26T13:08:54.316802Z",
"iopub.status.idle": "2024-09-26T13:08:56.446444Z",
"shell.execute_reply": "2024-09-26T13:08:56.437430Z"
}
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
Expand Down Expand Up @@ -85,6 +98,12 @@
"id": "054c77b0-855c-46bf-b861-96d430d90d56",
"metadata": {
"editable": true,
"execution": {
"iopub.execute_input": "2024-09-26T13:08:56.455101Z",
"iopub.status.busy": "2024-09-26T13:08:56.454327Z",
"iopub.status.idle": "2024-09-26T13:08:57.060682Z",
"shell.execute_reply": "2024-09-26T13:08:57.057348Z"
},
"slideshow": {
"slide_type": ""
},
Expand Down Expand Up @@ -166,6 +185,12 @@
"id": "a4cac17f-6ce5-41a3-8960-a781dc95e6b7",
"metadata": {
"editable": true,
"execution": {
"iopub.execute_input": "2024-09-26T13:08:57.071254Z",
"iopub.status.busy": "2024-09-26T13:08:57.070840Z",
"iopub.status.idle": "2024-09-26T13:08:57.639707Z",
"shell.execute_reply": "2024-09-26T13:08:57.638203Z"
},
"slideshow": {
"slide_type": ""
},
Expand Down Expand Up @@ -228,6 +253,12 @@
"id": "85c9972d-3e71-4737-9465-9f0f3d54b8ce",
"metadata": {
"editable": true,
"execution": {
"iopub.execute_input": "2024-09-26T13:08:57.655440Z",
"iopub.status.busy": "2024-09-26T13:08:57.654922Z",
"iopub.status.idle": "2024-09-26T13:08:58.366998Z",
"shell.execute_reply": "2024-09-26T13:08:58.358514Z"
},
"slideshow": {
"slide_type": ""
},
Expand Down Expand Up @@ -335,6 +366,12 @@
"id": "04b1309e-b74f-4f33-bde8-b153bd340586",
"metadata": {
"editable": true,
"execution": {
"iopub.execute_input": "2024-09-26T13:08:58.387866Z",
"iopub.status.busy": "2024-09-26T13:08:58.385982Z",
"iopub.status.idle": "2024-09-26T13:08:58.425961Z",
"shell.execute_reply": "2024-09-26T13:08:58.425325Z"
},
"slideshow": {
"slide_type": ""
},
Expand Down Expand Up @@ -379,6 +416,12 @@
"id": "a44fa090-e2b0-4029-969c-595e0083d09a",
"metadata": {
"editable": true,
"execution": {
"iopub.execute_input": "2024-09-26T13:08:58.428628Z",
"iopub.status.busy": "2024-09-26T13:08:58.428420Z",
"iopub.status.idle": "2024-09-26T13:09:00.286982Z",
"shell.execute_reply": "2024-09-26T13:09:00.285853Z"
},
"slideshow": {
"slide_type": ""
},
Expand Down Expand Up @@ -490,6 +533,12 @@
"id": "1da6f085-191c-4b9d-b425-10a0f29d9fec",
"metadata": {
"editable": true,
"execution": {
"iopub.execute_input": "2024-09-26T13:09:00.300819Z",
"iopub.status.busy": "2024-09-26T13:09:00.299457Z",
"iopub.status.idle": "2024-09-26T13:09:01.475967Z",
"shell.execute_reply": "2024-09-26T13:09:01.473354Z"
},
"slideshow": {
"slide_type": ""
},
Expand Down Expand Up @@ -723,6 +772,12 @@
"id": "b29ec7fb-2a4b-4d64-ac66-426f3bc9b6d5",
"metadata": {
"editable": true,
"execution": {
"iopub.execute_input": "2024-09-26T13:09:01.496620Z",
"iopub.status.busy": "2024-09-26T13:09:01.494011Z",
"iopub.status.idle": "2024-09-26T13:10:12.137603Z",
"shell.execute_reply": "2024-09-26T13:10:12.136286Z"
},
"slideshow": {
"slide_type": ""
},
Expand All @@ -733,7 +788,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Last updated: Wed Sep 18 2024\n",
"Last updated: Thu Sep 26 2024\n",
"\n",
"Python implementation: CPython\n",
"Python version : 3.12.3\n",
Expand All @@ -743,11 +798,11 @@
"jax : 0.4.31\n",
"jaxlib: 0.4.31\n",
"\n",
"seaborn : 0.13.2\n",
"sys : 3.12.3 | packaged by conda-forge | (main, Apr 15 2024, 18:38:13) [GCC 12.3.0]\n",
"IPython : 8.23.0\n",
"seaborn : 0.13.2\n",
"numpy : 1.26.0\n",
"matplotlib: 3.8.4\n",
"IPython : 8.23.0\n",
"\n",
"Watermark: 2.4.3\n",
"\n"
Expand Down
Loading

0 comments on commit 5bbc745

Please sign in to comment.