Skip to content

Commit

Permalink
rename the network submodule to utils (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
LegrandNico authored May 24, 2024
1 parent 9742d20 commit 646a0c3
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,15 @@ least the HGF instance as input after observation and returning surprise.
binary_softmax
binary_softmax_inverse_temperature

Networks
********
Utils
*****

Utilities for manipulating networks of probabilistic nodes.
Utilities for manipulating neural networks.

.. currentmodule:: pyhgf.networks
.. currentmodule:: pyhgf.utils

.. autosummary::
:toctree: generated/pyhgf.networks
:toctree: generated/pyhgf.utils

beliefs_propagation
trim_sequence
Expand Down
2 changes: 1 addition & 1 deletion docs/source/notebooks/0.3-Generalised_filtering.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"from matplotlib.ticker import MultipleLocator\n",
"from pyhgf.math import MultivariateNormal, Normal, gaussian_predictive_distribution\n",
"from pyhgf.model import HGF\n",
"from pyhgf.networks import beliefs_propagation\n",
"from pyhgf.utils import beliefs_propagation\n",
"from scipy.special import gammaln\n",
"from scipy.stats import norm, t\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/notebooks/Example_3_Multi_armed_bandit.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@
"metadata": {},
"outputs": [],
"source": [
"from pyhgf.networks import beliefs_propagation"
"from pyhgf.utils import beliefs_propagation"
]
},
{
Expand Down
12 changes: 6 additions & 6 deletions src/pyhgf/model/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
from jax.tree_util import Partial
from jax.typing import ArrayLike

from pyhgf.networks import (
beliefs_propagation,
fill_categorical_state_node,
get_update_sequence,
to_pandas,
)
from pyhgf.plots import plot_correlations, plot_network, plot_nodes, plot_trajectories
from pyhgf.typing import (
AdjacencyLists,
Expand All @@ -25,6 +19,12 @@
UpdateSequence,
input_types,
)
from pyhgf.utils import (
beliefs_propagation,
fill_categorical_state_node,
get_update_sequence,
to_pandas,
)


class Network:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from pyhgf import load_data
from pyhgf.math import binary_surprise, gaussian_density, sigmoid
from pyhgf.networks import beliefs_propagation
from pyhgf.typing import AdjacencyLists, Inputs
from pyhgf.updates.posterior.binary import binary_node_update_infinite
from pyhgf.updates.posterior.continuous import continuous_node_update
Expand All @@ -24,6 +23,7 @@
from pyhgf.updates.prediction_error.nodes.continuous import (
continuous_node_prediction_error,
)
from pyhgf.utils import beliefs_propagation


class Testbinary(TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from pyhgf import load_data
from pyhgf.math import gaussian_surprise
from pyhgf.networks import beliefs_propagation
from pyhgf.typing import AdjacencyLists, Inputs
from pyhgf.updates.posterior.continuous import (
continuous_node_update,
Expand All @@ -22,6 +21,7 @@
from pyhgf.updates.prediction_error.nodes.continuous import (
continuous_node_prediction_error,
)
from pyhgf.utils import beliefs_propagation


@pytest.fixture(scope="module")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import jax.numpy as jnp

from pyhgf.networks import beliefs_propagation, list_branches
from pyhgf.typing import AdjacencyLists, Inputs
from pyhgf.updates.posterior.continuous import (
continuous_node_update,
Expand All @@ -14,6 +13,7 @@
from pyhgf.updates.prediction_error.inputs.continuous import (
continuous_input_prediction_error,
)
from pyhgf.utils import beliefs_propagation, list_branches


class TestStructure(TestCase):
Expand Down

0 comments on commit 646a0c3

Please sign in to comment.