Question about Chance-constrained Active Inference example #337
-
When I learn the Chance-constrained Active Inference example, I try to enlarge the wind(t::Int64) = -5.0*(60 <= t < 100) # Time-dependent wind profile And I set the hyper parameters as follows: lo = 5.0 # Chance region lower bound
hi = 10.0 # Chance region upper bound Then the result is |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I think the result may be the definition of transition model in @model function regulator_model(T, m_u, v_u, x_t, wind_t, lo, hi, epsilon, atol)
# Loop over horizon
x_k_last = x_t
for k = 1:T
u[k] ~ NormalMeanVariance(m_u[k], v_u[k]) # Control prior
x[k] ~ x_k_last + u[k] + wind_t # Transition model
x[k] ~ ChanceConstraint(lo, hi, epsilon, atol) where { # Simultaneous constraint on state
dependencies = RequireMessageFunctionalDependencies(out = NormalWeightedMeanPrecision(0.0, 0.01))} # Predefine inbound message to break circular dependency
x_k_last = x[k]
end
end At the same time, I modify the function compute(x_t::Float64, wind_t::Float64)
model_t = regulator_model(;T=T, lo=lo, hi=hi, epsilon=epsilon, atol=atol)
data_t = (m_u = m_u, v_u = v_u, x_t = x_t, wind_t = wind_t)
result = infer(
model = model_t,
data = data_t,
iterations = n_its)
pol = mode.(result.posteriors[:u][1])
return pol What's more, I modify the control prior precision to lambda = 0.1 # Control prior precision |
Beta Was this translation helpful? Give feedback.
-
Thanks for your question. The wind illustrates a misalignment between the generative process (GP, the environment) and the generative model (GM, the agent beliefs). This example simulates an event (a gust of wind) that is unexpected by the agent, and therefore the agent may not be able to correct for it. When the agent models the event explicitly, then GP and GM will align again (the event is expected), and corrections may be more effective. (Although I suspect your timing is off by one). Note that, even if the GP and GM align, there is per definition a non-zero probability that the chance constraint is violated. |
Beta Was this translation helpful? Give feedback.
Thanks for your question. The wind illustrates a misalignment between the generative process (GP, the environment) and the generative model (GM, the agent beliefs). This example simulates an event (a gust of wind) that is unexpected by the agent, and therefore the agent may not be able to correct for it.
When the agent models the event explicitly, then GP and GM will align again (the event is expected), and corrections may be more effective. (Although I suspect your timing is off by one). Note that, even if the GP and GM align, there is per definition a non-zero probability that the chance constraint is violated.