Code Monkey home page Code Monkey logo

pso's Introduction

Particle Swarm Optimization (PSO)

This repoistory contains research about Particle Swarm Optimization (PSO) and it's implementation to optimize Artificial Neural Network (ANN)

Including

Why Traning Neural Network with Particle Swarm Optimization instead of Gradient Descent

  • Motivation

    • Gradient Descent requires differentiable activation function to calculate derivates making it slower than feedforward
    • To speed up backprop lot of memory is required to store activations
    • Backpropagation is strongly dependent on weights and biases initialization. A bad choice can lead to stagnation at local minima and so a suboptimal solution is found.
    • Backpropagation cannot make full use of parallelization due to its sequential nature
  • Advantages of PSO

    • PSO does not require a differentiable or continous function
    • PSO leads to better convergence and is less likely to get stuck at local minima
    • Faster on GPU

Environment

  • Windows 10
  • AMD GPU radeon 530
  • Python 3.9
  • matplotlib 3.3
  • numpy 1.19.5
  • scikit-learn 0.24
  • scipy 1.6.0

Run example with MNIST

$ git clone https://github.com/aboelkassem/PSO.git
$ cd PSO
$ python example_mnist.py

Demo and The Efficient of Results

the following diagram and reports shows the performance of testing data of the dataset including 10 classes (digits classes)

pso's People

Contributors

aboelkassem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

mohammedqaraad

pso's Issues

How can I set shape in my own network?

Hi I have a problem with the dim_weights() function and its input as shape?
the size of shape in (num_inputs, 64, 32, num_classes), could you please tell me what is 64 and 32? and how you calculate the dimension of weight matrix in dim_weights function?

shape = (num_inputs, 64, 32, num_classes)

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.