You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've introducing inconsistent return types for CLs-like / p-value-like values now in PR #1162. Previously, all CLs-like / p-value-like values were 0-d tensors
However, now we have things like hypotest returning 0-d tensors and things like pvalues and expected_pvalues returning floats only for NumPy and for all other backends returning 0-d tensors, yet in all the examples we're showing CLs-like / p-value-like values being returned.
Example: Run the docstring example from expected_pvalues for various backends and note the return type of CLs_exp_band[0].
backend: numpy
CLs expected band: [0.0026062609501074576, 0.01382005356161206, 0.06445320535890459, 0.23525643861460702, 0.573036205919389]
of type: <class 'numpy.float64'> and shape ()
backend: pytorch
CLs expected band: [tensor(0.0026), tensor(0.0138), tensor(0.0645), tensor(0.2353), tensor(0.5730)]
of type: <class 'torch.Tensor'> and shape ()
backend: jax
CLs expected band: [DeviceArray(0.00260626, dtype=float64), DeviceArray(0.01382005, dtype=float64), DeviceArray(0.0644532, dtype=float64), DeviceArray(0.23525643, dtype=float64), DeviceArray(0.57303619, dtype=float64)]
of type: <class 'jax.interpreters.xla._DeviceArray'> and shape ()
We should try to come to a consensus on what the return type for a CLs-like / p-value-like value should be. From looking back at PR #944 and Issue #714, I think that the CLs-like values should be 0-d tensor as it allows for us to sidestep this difference in backend behavior (I believe this is the motivation for the current behavior). While conceptually it makes sense to have a p-value-like just be a float to emphasize the scalar nature, having it be a 0-d tensor make it appear to a user as still having scalar like behavior.
The text was updated successfully, but these errors were encountered:
We've introducing inconsistent return types for CLs-like / p-value-like values now in PR #1162. Previously, all CLs-like / p-value-like values were
0
-d tensorspyhf/src/pyhf/infer/__init__.py
Line 149 in 0e71f2f
However, now we have things like
hypotest
returning0
-d tensors and things likepvalues
andexpected_pvalues
returning floats only for NumPy and for all other backends returning0
-d tensors, yet in all the examples we're showing CLs-like / p-value-like values being returned.Example: Run the docstring example from
expected_pvalues
for various backends and note the return type ofCLs_exp_band[0]
.gives
We should try to come to a consensus on what the return type for a CLs-like / p-value-like value should be. From looking back at PR #944 and Issue #714, I think that the CLs-like values should be
0
-d tensor as it allows for us to sidestep this difference in backend behavior (I believe this is the motivation for the current behavior). While conceptually it makes sense to have a p-value-like just be a float to emphasize the scalar nature, having it be a0
-d tensor make it appear to a user as still having scalar like behavior.The text was updated successfully, but these errors were encountered: