Giter Club home page Giter Club logo

Comments (1)

albertpod avatar albertpod commented on July 28, 2024

The FFG wasn't constructed properly, in particular, the observations were causing a collider. The code below fixes the issue.

using ForneyLab

n_samples = 100
A = [1 1; 0 1] # Transtiion matrix
u = [0.5, 1] # Control vector
c = zeros(2); c[1] = 1 # unit vector (observation vector)
x = [A*[x_t, 1] for x_t in 1:n_samples] # real state
y = [c'x[t] + sqrt(100)*randn() for t in 1:n_samples] # noisy observations of postition

# Graph definition
g = FactorGraph()

@RV x_t_min ~ GaussianMeanVariance(placeholder(:m_x_t_min, dims=(2,)), 
                                   placeholder(:v_x_t_min, dims=(2, 2)))

@RV x_t = A*x_t_min
c = zeros(2); c[1] = 1;
@RV y_t ~ GaussianMeanPrecision(dot(c, x_t), 0.01)

placeholder(y_t, :y_t)

ForneyLab.draw(g)

# Specify recognition factorization
q = RecognitionFactorization(x_t, ids=[:X_t])
# Construct free energy algorithm
algoF = freeEnergyAlgorithm()

println(algoF)

from forneylab.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.