Giter Club home page Giter Club logo

annpso's Introduction

ANNPSO

Repo for the final year college project.

Proposed idea: Training a neural network with the help of particle swarm optimization (PSO) instead of the traditional backprop and gradient descent.

Current issues with backprop:

  1. Convergence: Having a single initialization point for weights and biases often leads to a suboptimal convergence at a local minimum. Another major issue is the vanishing gradient problem, i.e., plateau regions in the function topology where the slope is zero.

  2. Derivatives: Calculating them requires a differentiable non-linear activation function. Thus backprop is inherently ~2x slower than feedforward.

This where PSO comes in: a combinatorial optimization method which:

  1. Ensures a good convergence point if done right.

  2. Does not require a differentiable "fitness" function.

Purely PSO-based:

Currently what this repo is all about. Completely eliminating backprop from the equation and relying solely on PSO.

Results: It has been established that a network is certainly trainable by this method. We over-fit a basic XOR network (5-3-3-3-1) and observed the losses. Using 32 particles, it took roughly 2k iterations for the training loss to drop to 0.06 (~94% training accuracy). Largely over-fit, but trainable nonetheless.

Training using both PSO and backprop for a better rate of convergence. Current results are far better than a purely PSO based approach, but the method itself is a major memory-hog.

Issues on this repo serve more as a to-do list than as actual issues.
Any suggestions and feedback are welcome. Feel free to raise an issue.

annpso's People

Contributors

c-soni avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

annpso's Issues

Make provisions for more activation functions.

Activation functions are currently hard coded; allow programmability without compromising performance.
That pretty much rules out maintaining a list of activations and branching the code accordingly.

Allow loading of weights and biases from a previous dump and continue training.

Upon loading the weights, 1 epoch will be run of the regular train function and 1 feed forward pass will be computed for the stored weights, and the losses will be evaluated. The worst particle obtained from the train function will be replaced by the dump if the dump is better, else the dump will be discarded altogether.

Optimize the damn thing.

All the cudaDeviceSynchronize calls and probably even the memory access pattern and cache alignment are suboptimal, experiment with other patterns and cuda streams.

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.