Skip to content

Commit 1e1318a

Browse files
authored
Merge pull request #160 from ilabcode/dev
Versio 0.5.4
2 parents 5e2da94 + b1a24b0 commit 1e1318a

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

src/ActionModels_variations/utils/reset.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ function reset_state!(node::CategoricalStateNode)
7979

8080
node.states.posterior .= missing
8181
node.states.value_prediction_error .= missing
82-
node.states.prediction .= missing
83-
node.states.parent_predictions .= missing
82+
node.states.prediction .= 1/length(node.states.prediction)
83+
node.states.parent_predictions .= 1/length(node.states.parent_predictions)
8484

8585
return nothing
8686
end
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using Test
2+
using HierarchicalGaussianFiltering
3+
4+
5+
@testset "Test get_surprise" begin
6+
7+
@testset "Test for state-transition HGF" begin
8+
9+
#Set up test inputs
10+
test_inputs = [
11+
missing missing 2 missing
12+
missing 1 missing missing
13+
missing missing missing 3
14+
missing missing missing missing
15+
3 missing missing missing
16+
]
17+
18+
#Initialize HGF
19+
HGF_test = premade_hgf("categorical_state_transitions", verbose = false)
20+
21+
#Give inputs
22+
give_inputs!(HGF_test, test_inputs)
23+
24+
#Get surprise
25+
@test get_surprise(HGF_test) isa Real
26+
27+
end
28+
end

0 commit comments

Comments
 (0)