Coder Social home page Coder Social logo

giosueio / binarynnwithsa Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.37 MB

Using Simulated Annealing to train feedforward Binary Neural Networks with weights and activations constrained to {-1,1}

Julia 100.00%
julia machine-learning simulated-annealing

binarynnwithsa's Introduction

Fitting Binary Neural Networks with Simulated Annealing

Using Simulated Annealing (SA) to train multiclass classification feedforward Neural Networks with weights and activations constrained to {-1,1} aka Binary Neural Networks (BNNs).

Repository structure

The two main Julia scripts are in src/:

Script Description
BNN.jl Contains structs and functions defining the core of the BNN implementation and of SA optimization procedure
BNN_operators.jl Contains some ancillary function implemented to ease notation & computation

BNN_analysis.jl contains some additional functions used to analyze weight configurations obtained with the algorithm.

Function Description
solution_landscape Change at random an increasing portion of the weight matrix, see how error on the trainin set changes consequentially
test_layer_elements For a given number of layers H, plot how the error changes on the training set as more units are added to each layer
test_number_layers For a given number of units M per layer, plot how the error changes on the training set as more layers are added

The presentation BNNwithSA.pdf presents tests on two datasets:

  • Breast Cancer Wisconsin dataset for binary classification
  • Iris dataset for multiclass classification

Quick start

Clone the repo, cd the project's folder and install the depencies by running on Julia

pkg> activate .
(BNN) pkg> instantiate

One can then access the repo's methods by specifying

(BNN) julia> using BNN
(BNN) julia> include("BNN_analysis.jl") 

Credits

Project by Giosuè Migliorini ([email protected]) as part of the course 20602 - COMPUTER SCIENCE (ALGORITHMS), taught by professors C.Feinauer and F.Pittorino. Reference to relevant literature on the topic can be found in BNNwithSA.pdf

binarynnwithsa's People

Contributors

giosueio avatar

Stargazers

 avatar

Watchers

 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.