Diagnostics¶
Whether a state-dependent R(x) earns its keep is a question about the states an action can actually reach. A noise that varies only where no policy goes is, for every purpose the filter and the objective have, a constant. probe_model samples the reachable set and reports back a ProbeReport: whether R is positive definite at every sample, whether it moves at all, and whether the epistemic value moves with it. The set is sampled, not exhausted, so a negative is evidence rather than proof.
probe_model ¶
probe_model(
model: LinearGaussianModel | GraphBackend,
belief: Belief,
actions: Sequence[ArrayLike],
*,
tol: float = 1e-12,
) -> ProbeReport
Probe a model's sensor over the predicted means a set of actions reaches.
Each action is pushed through the prediction step to get (μ⁻, Σ⁻); the sensor is
linearized at each μ⁻ and the four conditions are evaluated over the resulting
sample. This is the reachable set the conditions are about — vary actions to
widen it. A state-dependent Q(x) enters Σ⁻ at each μ⁻, where the EFE
kernel evaluates it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
LinearGaussianModel | GraphBackend
|
a |
required |
belief
|
Belief
|
the belief to predict from — the shared prior every action starts at. |
required |
actions
|
Sequence[ArrayLike]
|
the candidate actions to sample. |
required |
tol
|
float
|
below this, two noise covariances or two epistemic values count as equal. |
1e-12
|
Returns:
| Type | Description |
|---|---|
ProbeReport
|
A |
Raises:
| Type | Description |
|---|---|
TypeError
|
If |
ValueError
|
If |
Source code in src/cpomdp/diagnostics.py
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 | |
ProbeReport
dataclass
¶
ProbeReport(
n_samples: int,
n_observations: int,
observation_matrix_rank: int,
observation_matrix_full_row_rank: bool,
observation_noise_definite: bool,
observation_noise_indefinite_at: tuple[
tuple[float, ...], ...
],
observation_noise_varies: bool,
observation_noise_spread: float,
observation_noise_loewner_ordered: bool,
dynamics_noise_varies: bool,
dynamics_noise_spread: float,
epistemic_varies: bool,
epistemic_range: tuple[float, float],
)
What probe_model found over the sampled reachable set.
Each field is named for the object it describes: the observation matrix C, the
observation noise R, the dynamics noise Q or the epistemic value.
Attributes:
| Name | Type | Description |
|---|---|---|
n_samples |
int
|
how many predicted means were probed. |
n_observations |
int
|
the number of observation channels, |
observation_matrix_rank |
int
|
the rank of |
observation_matrix_full_row_rank |
bool
|
whether |
observation_noise_definite |
bool
|
whether |
observation_noise_indefinite_at |
tuple[tuple[float, ...], ...]
|
the sampled means where it was not. |
observation_noise_varies |
bool
|
whether |
observation_noise_spread |
float
|
the largest pairwise distance between the sampled
|
observation_noise_loewner_ordered |
bool
|
whether the extreme pair of sampled |
dynamics_noise_varies |
bool
|
whether |
dynamics_noise_spread |
float
|
the largest pairwise distance between the sampled |
epistemic_varies |
bool
|
whether the epistemic value differed across the samples. |
epistemic_range |
tuple[float, float]
|
its smallest and largest sampled values, in nats. |
flattens
property
¶
Whether the sampled evidence says the noise is a constant in disguise.
True when neither R nor Q moved across the sampled means: the covariance
recursion then never consults the action, so a fixed noise schedule reproduces
the agent and the epistemic term cannot tell two policies apart. A Q(x) that
moves keeps it False with R fixed, since the action then reaches the
recursion through Q.
summary ¶
A few lines a human can read, one per condition.
Source code in src/cpomdp/diagnostics.py
A flat LinearGaussianModel and a graph backend reach their predicted means by different routes, so probe_model takes either. Pass a CouplingGraphBackend as the second.