GithubHelp home page GithubHelp logo

hopfieldnetwork's Introduction

HopfieldNetwork

Setup

Requirements
ghc ( if you want to build the API yourself )
raku 
zef 
all you need to do is run the file :
git clone [this repo]
setup.bat 
or manually
zef install JSON::Tiny
zef install Terminal::ANSIColor
ghc main.hs 

Last Updates :

  • Implementation of native Haskell API to process the binary vectors and transformations
  • if you do not want to compile the API download the exe here : My drive!

Some theory :

The theory behind Hopfield Networks can be found here :

EDX free course about computational neuroscience !

The ideia :

The goal of Hopfield models is to a mathematical model to associative memory especially for images

Here I could implement a first of this model, but there's still a long path towards a totally useful model

Start :

Images can be binary multidimensional arrays like this example :

(Illustrative example)

Here we create a hash from multidimensional arrays that are our images from the /images folder
my $trainingset = ImageSet.new(
    myimages=>{
        "image0"=>"image0.json",
        "image1"=>"image1.json"
    }
);
my $testingset = ImageSet.new(
    myimages=>{
        "image2"=>"image2.json"
    }
);
# this is the info that will populate our training information 
my $mytrainingsetfinal = $trainingset.genSet(8); 
# this will be the ones used to test the net 
my $mytestingsetfinal = $testingset.genSet(8);
To create a new net :
my $model = HopfieldNetwork.new(
    dataset=>$mytrainingsetfinal,
    testset=>$mytestingsetfinal,
    title=>"mynet"
); # here we use our generated formatted data to feed the net 
To run a prediction :
$model.predict # store the result 
$model.showResult # show the similarities 
To save your current model :
$model.export # this goes as mymodel.json
To load a new model :
$mode.loadModel("mynet") # here goes the name of the json exported from model

Future goals :

  • Implementation of zef or panda module
  • Implementation of higher features from Hopfield Models and variations

hopfieldnetwork's People

Contributors

synth-me 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.