@@ -50,7 +50,7 @@ def r2(self):
50
50
def r2_std (self , request ):
51
51
return request .param
52
52
53
- @pytest .fixture (params = ["true" , "false" , "limit-1" , "limit-0" ])
53
+ @pytest .fixture (params = ["true" , "false" , "limit-1" , "limit-0" , "limit-all" ])
54
54
def positive_probs (self , input_std , request ):
55
55
if request .param == "true" :
56
56
return np .full_like (input_std , 0.5 )
@@ -64,6 +64,8 @@ def positive_probs(self, input_std, request):
64
64
ret = np .full_like (input_std , 0.5 )
65
65
ret [..., 0 ] = 0
66
66
return ret
67
+ elif request .param == "limit-all" :
68
+ return np .full_like (input_std , 0 )
67
69
68
70
@pytest .fixture (params = [True , False ], ids = ["probs-std" , "no-probs-std" ])
69
71
def positive_probs_std (self , positive_probs , request ):
@@ -122,14 +124,15 @@ def test_init(
122
124
assert eps .eval ().shape == output_std .shape
123
125
assert beta .eval ().shape == input_std .shape
124
126
# r2 rv is only created if r2 std is not None
127
+ assert "beta" in model .named_vars
125
128
assert ("beta::r2" in model .named_vars ) == (r2_std is not None ), set (model .named_vars )
126
129
# phi is only created if variable importance is not None and there is more than one var
127
130
assert ("beta::phi" in model .named_vars ) == (
128
131
"variables_importance" in phi_args or "importance_concentration" in phi_args
129
132
), set (model .named_vars )
130
- assert ("beta::psi" in model .named_vars ) == (positive_probs_std is not None ), set (
131
- model . named_vars
132
- )
133
+ assert ("beta::psi" in model .named_vars ) == (
134
+ positive_probs_std is not None and positive_probs_std . any ()
135
+ ), set ( model . named_vars )
133
136
assert np .isfinite (sum (model .point_logps ().values ())), model .point_logps ()
134
137
135
138
def test_failing_importance (self , dims , input_shape , output_std , input_std ):
0 commit comments