File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed
src/ActionModels_variations/utils Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -79,8 +79,8 @@ function reset_state!(node::CategoricalStateNode)
79
79
80
80
node. states. posterior .= missing
81
81
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)
84
84
85
85
return nothing
86
86
end
Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments