Giter VIP home page Giter VIP logo

neural_networks_with_pso's Introduction

neural_networks_with_pso

Training a Neural Network with PSO and comparing its performance to homemade backpropagation algorithm.

Main Code

The main python code and classes is situated in the "/classes" folder. Two classes are to distinguish:

  • Network
  • PSO

The network class implements both the feedfoward and the backpropagation algorithm (in the method train) for an ANN. The PSO class implements the PSO algorithm, giving the user the choice of the hyperparameters and of the velocity update function.

In the "utils.py" file, you will find utility functions that are used throughout this project.

The main.py file is an obsolete file we used at first to run experiment. Due to its lack of flexibility, we changed for a Jupyter notebook.

Experiments

The run experiments are found in the experiments.ipynb. This is a jupyter notebook and it can be run by typing the following command in a terminal:

jupyter notebook

This will open a new tab in the default browser and the experiments notebook will be choosable. Some experiments take multiple dozens of minutes to run unfortunately (on a i7, 16go ram machine). The results of these experiments, stored as Python dictionnaries, have been "pickled" into 3 files that can be loaded in code using:

import pickle

variable = pickle.load( open(filename, "rb" ) )

where filename can be equal to "results_experiments_one.dictionnary", "results_experiments_two.dictionnary","results_experiments_three.dictionnary".

neural_networks_with_pso's People

Contributors

dimartinot avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

huangzili2015

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.