Giter Site home page Giter Site logo

epdilutedclassifier's Introduction

Code to reproduce the results of the paper "Expectation propagation on the diluted classifier" by Alfredo Braunstein, Thomas Gueudré, Andrea Pagnani and Mirko Pieropan [1]. This package uses the implementation of Gaussian EP available at [2].

Installation

After dowloading the repository, open Julia, change your current directory to that of the repository and type ] to enter the Pkg REPL. From there, run activate . and then instantiate in order to install all required dependencies. These instructions can be executed automatically at Julia startup by including the following lines of code in the ~/.julia/config/startup.jl file (create the ~/.julia/config folder and the file if not already present):

using Pkg 
if isfile("Project.toml") && isfile("Manifest.toml") 
    Pkg.activate(".") 
end

Usage

The routines needed to perform the EP inference can be found in SparsePerceptron.jl and in run_instances.jl. The generative models for the weights of the teacher perceptron and for the training set of patterns are implemented in generate_instances.jl.

Tests

Some simple tests can be run by including the following scripts in Julia from the Julia REPL:

  • test_gaussian_iid_noiseless.jl: sparse perceptron learning from a set of correctly labeled i.i.d. Gaussian patterns;
  • test_gaussian_cor_noiseless.jl: sparse perceptron training using a set of correctly labeled patterns sampled from a multivariate Gaussian distribution;
  • test_noisy_case.jl: the script runs an example of student perceptron learning from a set of i.i.d. Gaussian patterns and another one from correlated Gaussian patterns. In both cases, a small fraction of the examples are mislabeled.
  • test_corr_binary_patterns_noiseless.jl: sparse perceptron learning from a set of correctly labeled binary patterns generated by a network of perceptrons according to an asynchronous Glauber dynamics at zero temperature.

Each script runs the EP based inference on a randomly generated instance and prints the teacher-student overlap and the related mean squared error in dB (both as the estimation is performed and at the end of the inference procedure).

References

[1] Alfredo Braunstein, Thomas Gueudré, Andrea Pagnani, and Mirko Pieropan. Expectation propagation on the diluted Bayesian classifier. Phys. Rev. E 103 043301 (Apr. 2021).

[2] GaussianEP package: https://github.com/abraunst/GaussianEP

epdilutedclassifier's People

Contributors

mpieropan avatar

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.