Skip to content

Commit

Permalink
Replace input nodes with state nodes receiving observations (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
LegrandNico authored Sep 27, 2024
1 parent a8d2350 commit 838f16d
Show file tree
Hide file tree
Showing 62 changed files with 8,002 additions and 4,630 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repos:
args: ['--ignore', 'D213,D100,D203,D104']
files: ^src/
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.11.1'
rev: 'v1.11.2'
hooks:
- id: mypy
files: ^src/
Expand Down
81 changes: 21 additions & 60 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_infinite
binary_node_update_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 All @@ -54,8 +43,8 @@ Continuous nodes

posterior_update_mean_continuous_node
posterior_update_precision_continuous_node
continuous_node_update
continuous_node_update_ehgf
continuous_node_posterior_update
continuous_node_posterior_update_ehgf

Exponential family
------------------
Expand Down Expand Up @@ -109,75 +98,46 @@ 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
^^^^^^^^^^^^^^^^^^^^^^

.. currentmodule:: pyhgf.updates.prediction_error.nodes.continuous
.. currentmodule:: pyhgf.updates.prediction_error.continuous

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

continuous_node_value_prediction_error
continuous_node_volatility_prediction_error
continuous_node_prediction_error

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

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

.. autosummary::
:toctree: generated/pyhgf.updates.prediction_error.nodes.dirichlet
:toctree: generated/pyhgf.updates.prediction_error.dirichlet

dirichlet_node_prediction_error
update_cluster
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
Binary file removed docs/source/images/binary.png
Binary file not shown.
153 changes: 153 additions & 0 deletions docs/source/images/binary.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/source/images/categorical.png
Binary file not shown.
Loading

0 comments on commit 838f16d

Please sign in to comment.