Skip to content

Commit

Permalink
Merge pull request #160 from ilabcode/dev
Browse files Browse the repository at this point in the history
Versio 0.5.4
  • Loading branch information
PTWaade authored Aug 9, 2024
2 parents 5e2da94 + b1a24b0 commit 1e1318a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ActionModels_variations/utils/reset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ function reset_state!(node::CategoricalStateNode)

node.states.posterior .= missing
node.states.value_prediction_error .= missing
node.states.prediction .= missing
node.states.parent_predictions .= missing
node.states.prediction .= 1/length(node.states.prediction)
node.states.parent_predictions .= 1/length(node.states.parent_predictions)

return nothing
end
Expand Down
28 changes: 28 additions & 0 deletions test/testsuite/test_get_surprise.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Test
using HierarchicalGaussianFiltering


@testset "Test get_surprise" begin

@testset "Test for state-transition HGF" begin

#Set up test inputs
test_inputs = [
missing missing 2 missing
missing 1 missing missing
missing missing missing 3
missing missing missing missing
3 missing missing missing
]

#Initialize HGF
HGF_test = premade_hgf("categorical_state_transitions", verbose = false)

#Give inputs
give_inputs!(HGF_test, test_inputs)

#Get surprise
@test get_surprise(HGF_test) isa Real

end
end

2 comments on commit 1e1318a

@PTWaade
Copy link
Collaborator Author

@PTWaade PTWaade commented on 1e1318a Aug 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Minor changes

Fixed error with reset!() setting wrong initial values to categorical state nodes

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while trying to register: Version 0.5.3 already exists

Please sign in to comment.