GithubHelp home page GithubHelp logo

samuelsonric / algebraicinference.jl Goto Github PK

View Code? Open in Web Editor NEW
17.0 5.0 1.0 1.81 MB

Bayesian inference on wiring diagrams.

Home Page: https://samuelsonric.github.io/AlgebraicInference.jl/

License: MIT License

Julia 100.00%
julia applied-category-theory category-theory bayesian-inference bayesian-statistics inference message-passing probabilistic-graphical-models

algebraicinference.jl's Introduction

AlgebraicInference.jl

Build Status Dev Docs Code Coverage

AlgebraicInference.jl is a library for performing Bayesian inference on wiring diagrams, building on Catlab.jl. See the documentation for example notebooks and an API.

How to Use

using AlgebraicInference
using Catlab.Programs

wd = @relation (X,) where (X::m, Y::n) begin
    prior(X)
    likelihood(X, Y)
    evidence(Y)
end

hom_map = Dict{Symbol, DenseGaussianSystem{Float64}}(
    :prior => normal(0, 1),           # p(X) = N(0, 1)
    :likelihood => kernel([1], 0, 1), # p(Y | X = x) = N(x, 1)
    :evidence => normal(2, 0))        # Y = 2

ob_map = Dict(
    :m => 1, # X ∈ ℝ¹
    :n => 1) # Y ∈ ℝ¹

problem = InferenceProblem(wd, hom_map, ob_map)

Σ = solve(problem)

inference

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.