GithubHelp home page GithubHelp logo

naereen / kullbackleibler.jl Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 0.0 58 KB

๐Ÿ’ซ Fast Julia implementation of various Kullback-Leibler divergences for 1D parametric distributions. ๐Ÿ‹ Also provides optimized code for kl-UCB indexes

Home Page: https://naereen.github.io/KullbackLeibler.jl/docs/index.html

License: MIT License

Makefile 0.55% Julia 44.56% CSS 10.69% JavaScript 11.41% HTML 32.79%
kullback-leibler-divergence kl-ucb bandit-algorithms divergence julia-package

kullbackleibler.jl's Issues

Create a method KL() to give a common interface

The current implementation needs to call klXYZ for each of the distribution XYZ. It will be great if you can provide a common interface to call KL divergence and dispatch depending on the type of the argument you get.
Ex:

using Distributions
# Example
KL( X1::Distributions.Bernoulli, X2::Distributions.Bernoulli ) = klBern( X1.p, X2.p )
KL( X1::Distributions.Exponential, X2::Distributions.Exponential ) = klExp( X1.ฮธ, X2.ฮธ )
# Use case
X = Bernoulli(0.33)
Y = Bernoulli(0.42)
d1 = KL( X, Y ) # Calc KL divergence for Bernoullli R.V
X = Exponential( 0.33 )
Y = Exponential( 0.42 )
d2 = KL( X, Y) # Calc KL div for Exponential R.V

I think this way, the users don't have to remember all the klXYZ function.

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.