Skip to content

Commit

Permalink
Merge branch 'dev' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
PTWaade authored Aug 5, 2024
2 parents 631de99 + 9eee372 commit 97ac20c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ authors = [ "Peter Thestrup Waade [email protected]",
"Anna Hedvig Møller [email protected]",
"Jacopo Comoglio [email protected]",
"Christoph Mathys [email protected]"]
version = "0.5.3"
version = "0.5.4"


[deps]
ActionModels = "320cf53b-cc3b-4b34-9a10-0ecb113566a3"
Expand Down
18 changes: 18 additions & 0 deletions src/utils/get_surprise.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ Equation:
"""
function get_surprise(node::ContinuousInputNode)

#If there was no input
if ismissing(node.states.input_value)
#Return no surprise
return 0
end

#Sum the predictions of the vaue parents
parents_prediction_mean = 0
for parent in node.edges.observation_parents
Expand All @@ -85,6 +91,12 @@ Calculate the surprise of a binary input node on seeing the last input.

function get_surprise(node::BinaryInputNode)

#If there was no input
if ismissing(node.states.input_value)
#Return no surprise
return 0
end

#Sum the predictions of the vaue parents
parents_prediction_mean = 0
for parent in node.edges.observation_parents
Expand Down Expand Up @@ -137,6 +149,12 @@ Calculate the surprise of a categorical input node on seeing the last input.
"""
function get_surprise(node::CategoricalInputNode)

#If there was no input
if ismissing(node.states.input_value)
#Return no surprise
return 0
end

#Get value parent
parent = node.edges.observation_parents[1]

Expand Down

0 comments on commit 97ac20c

Please sign in to comment.