Expected free energy¶
The scalar each candidate action is scored by — G = pragmatic − epistemic. The pragmatic term pulls toward preferred outcomes; the epistemic term rewards actions that sharpen the belief. Lower G is better.
expected_free_energy ¶
expected_free_energy(
model: LinearGaussianModel,
belief: Belief,
action: Float64[Array, p],
preference: Preference,
) -> tuple[
Float64[Array, ""], dict[str, Float64[Array, ""]]
]
Expected Free Energy of taking action from belief, and its split.
Computes G = pragmatic − epistemic for the locked linear-Gaussian
definition documented at the top of this module. Pure jnp, so it composes
under jit/vmap/grad — in particular vmap/grad over a batch
of candidate action vectors (with model/belief/preference held
fixed), which is how EFESelector will search.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
LinearGaussianModel
|
The generative model. Must have a control matrix (an action has no
meaning without one). Its |
required |
belief
|
Belief
|
The current belief |
required |
action
|
Float64[Array, p]
|
The candidate action |
required |
preference
|
Preference
|
The goal as an OBSERVATION-space |
required |
Returns:
| Type | Description |
|---|---|
Float64[Array, '']
|
|
dict[str, Float64[Array, '']]
|
non-negative components. Lower |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the model has no control matrix. |