Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert ehgf update step for value coupling #116

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions src/pyhgf/updates/continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,26 +190,18 @@ def ehgf_continuous_node_prediction_error(
# if this child is the last one relative to this parent's family, all the
# children will update the parent at once, otherwise just pass and wait
if edges[value_parent_idx].value_children[-1] == node_idx:
# in the eHGF update step, we use the expected precision here
# as we haven't computed it yet due to the reverse update order
precision_value_parent = attributes[value_parent_idx][
"expected_precision"
]

# Estimate the mean of the posterior distribution
mean_value_parent = prediction_error_mean_value_parent(
attributes, edges, value_parent_idx, precision_value_parent
)
# Update this parent's parameters
attributes[value_parent_idx]["mean"] = mean_value_parent

# Estimate the precision of the posterior distribution
precision_value_parent = prediction_error_precision_value_parent(
attributes, edges, value_parent_idx
)
# Estimate the mean of the posterior distribution
mean_value_parent = prediction_error_mean_value_parent(
attributes, edges, value_parent_idx, precision_value_parent
)

# Update this parent's parameters
attributes[value_parent_idx]["precision"] = precision_value_parent
attributes[value_parent_idx]["mean"] = mean_value_parent

#############################
# Update volatility parents #
Expand Down
Loading