Skip to content

Commit

Permalink
Initial update function added
Browse files Browse the repository at this point in the history
  • Loading branch information
LouieMH committed Dec 6, 2024
1 parent e3994fc commit e754c82
Showing 1 changed file with 56 additions and 9 deletions.
65 changes: 56 additions & 9 deletions docs/source/notebooks/Latent_var_notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -24,7 +24,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -134,7 +134,7 @@
"</svg>\n"
],
"text/plain": [
"<graphviz.sources.Source at 0x209b3f58da0>"
"<graphviz.sources.Source at 0x20ed7e15730>"
]
},
"execution_count": 5,
Expand Down Expand Up @@ -217,7 +217,7 @@
"</svg>\n"
],
"text/plain": [
"<graphviz.sources.Source at 0x209b3ff1eb0>"
"<graphviz.sources.Source at 0x20ed7cdd700>"
]
},
"execution_count": 7,
Expand All @@ -241,7 +241,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -373,7 +373,7 @@
"</svg>\n"
],
"text/plain": [
"<graphviz.sources.Source at 0x209b7c81730>"
"<graphviz.sources.Source at 0x20edbe03fb0>"
]
},
"execution_count": 14,
Expand All @@ -387,13 +387,23 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 28,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{-1: {'time_step': 0.0}, 0: {'mean': 0.0, 'expected_mean': 0.0, 'precision': 10000.0, 'expected_precision': 1.0, 'volatility_coupling_children': None, 'volatility_coupling_parents': (1.0,), 'value_coupling_children': None, 'value_coupling_parents': (1.0,), 'tonic_volatility': 0.0, 'tonic_drift': 0.0, 'autoconnection_strength': 0.0, 'observed': 1, 'temp': {'effective_precision': 0.0, 'value_prediction_error': 0.0, 'volatility_prediction_error': 0.0}}, 1: {'mean': 1.0357, 'expected_mean': 0.0, 'precision': 10000.0, 'expected_precision': 1.0, 'volatility_coupling_children': None, 'volatility_coupling_parents': None, 'value_coupling_children': (1.0,), 'value_coupling_parents': None, 'tonic_volatility': -13.0, 'tonic_drift': 0.0, 'autoconnection_strength': 1.0, 'observed': 1, 'temp': {'effective_precision': 0.0, 'value_prediction_error': 0.0, 'volatility_prediction_error': 0.0}}, 2: {'mean': 0.0, 'expected_mean': 0.0, 'precision': 10.0, 'expected_precision': 1.0, 'volatility_coupling_children': (1.0,), 'volatility_coupling_parents': None, 'value_coupling_children': None, 'value_coupling_parents': None, 'tonic_volatility': -2.0, 'tonic_drift': 0.0, 'autoconnection_strength': 1.0, 'observed': 1, 'temp': {'effective_precision': 0.0, 'value_prediction_error': 0.0, 'volatility_prediction_error': 0.0}}}\n"
]
}
],
"source": [
"attributes, edges, update_sequence = (\n",
" max_latent_hgf.get_network()\n",
")"
")\n",
"\n",
"print(attributes)"
]
},
{
Expand Down Expand Up @@ -461,6 +471,43 @@
"responses = jnp.asarray(responses) # vector of responses"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"ename": "IndentationError",
"evalue": "expected an indented block after function definition on line 5 (1391147169.py, line 8)",
"output_type": "error",
"traceback": [
"\u001b[1;36m Cell \u001b[1;32mIn[26], line 8\u001b[1;36m\u001b[0m\n\u001b[1;33m attributes, edges = (\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mIndentationError\u001b[0m\u001b[1;31m:\u001b[0m expected an indented block after function definition on line 5\n"
]
}
],
"source": [
" # Latent Update function\n",
"\n",
"def Latent_update(\n",
" network: Network,\n",
" attributes: Dict,\n",
" edges: Edges,\n",
" index: int\n",
" ):\n",
"\n",
" attributes, edges = (\n",
" Network.get_network()\n",
" )\n",
"\n",
" #add node to attributes\n",
"\n",
" #Add coupling: Attempted use of \"add_edges\" function\n",
" attributes, edges = add_edges(attributes, edges, 'value', new_node_idx, index)\n",
"\n",
" # ??? Create new network entirely? or alter existing network and return previous network altered\n",
" return network\n"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down

0 comments on commit e754c82

Please sign in to comment.