Assistance With a Basic Active Inference Implementation #106
Replies: 1 comment 2 replies
-
Hey @FraserP117 , thank you for the question. @Chengfeng-Jia implemented the "Bayesian thermostat" experiment in the Please check the experiment first as it uses modern capabilities of the |
Beta Was this translation helpful? Give feedback.
-
Hello BIASlab,
My name is Fraser, I'm a Computer Science Honours student at the University of Western Australia and I'm conducting my thesis on Active Inference. I fell in love with Active Inference shortly after watching the demonstration of ForneyLab.jl on the Active Inference YouTube channel. I’ve come here at the suggestion of Dmitry Bagaev.
Now I’m intending to use RxInfer.jl for implementing several Active Inference agents (along with python’s pyro package). I’m over the moon that something like RxInfer exists, thank you very much. While my thesis is on Active Inference, the whole topic is still very new to me and I'm having some difficulty with implementing my first few models. My only experience with implementing Active Inference thus far has been in extremely contrived scenarios with the pymdp package. I’ve walked through the initial tutorials on the “Getting Started” and “Model Specification” pages on the official site: https://biaslab.github.io/RxInfer.jl/stable/manuals/getting-started/.
I'm reaching out for any advice on how to use RxInfer to specify a basic Active Inference agent to solve the canonical "Bayesian Thermostat" problem. I am not attempting to use generalised coordinates – at least not yet – and so I’ve formulated the problem like this:
**"The agent can move left or right on the interval [0.0, 100.0].
For all x in the interval, T(x) = T_0/(1+x^2) is the temperature at
position x. T_0 is the temperature at x = 0.0, let T_0 = 100.0.
The agent can only observe the temperature at its current position and
it must use Active Inference to infer the position that will yield an
observed temperature as close as possible to 4.0 (an arbitrary preference).
The agent maintains an initial, uniform prior over the optimal location for soliciting the preferred observation, and the agent begins at x = 1.0 (for simplicity)."**
Enclosed is my first attempt to implement just such an approach with RxInfer. It won’t run without error at this stage, I only attach it to demonstrate how I have gone about framing an implementation of a solution to this problem. Please forgive my implementation, indeed, the form of the “custom_inference” function was lifted from the getting started page.
I wouldn't be reaching out with such a “forward” query if I was not feeling a sense of mounting dread, at thus far having failed to accomplish this embarrassingly simple task in the last two weeks. I feel that being able to implement a solution to this problem, will set me up to be able to conquer the more sophisticated problems I have set for myself, in the course of my thesis.
Absolutely any comments and suggestions from anyone here would be very greatly appreciated.
Thank you for your time and attention.
Fraser
Here is my attempted implementation:
Beta Was this translation helpful? Give feedback.
All reactions