Coder Social home page Coder Social logo

haeggee / swarm Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 4.0 117.16 MB

Optimization Methods for Engineers, ETH Zurich

Home Page: http://vvz.ethz.ch/Vorlesungsverzeichnis/lerneinheit.view?lerneinheitId=135215&semkez=2020S&ansicht=KATALOGDATEN&lang=de

License: MIT License

Jupyter Notebook 95.94% Python 4.06%

swarm's Introduction

Optimization Methods for Engineers - Particle Swarm Optimization, Nelder-Mead Binder

This repository includes sample applications and use cases of optimization methods, mainly particle swarm optimization. It was created as part of the course 'Optimization Methods for Engineers' at ETH Zürich. Go to https://mybinder.org/v2/gh/haeggee/swarm/master to play around with the notebooks yourself!

Part 1: Analysing optimizers on typical test functions for optimization

Test functions (Rastrigin, McCormick, Easom):
  1. Optimization with PSO:

    • Optimization
    • Plot cost history
    • Visualization in 2D
    • Visualization in 3D
    • Analysis of good choice of hyperparameters
  2. Comparison with Nelder Mead:

    • Performance
    • Convergence rate
    • Complexity
Discussion:
  1. Strengths
  2. Weaknesses

Part 2: Analysing PSO, NM for neural network training

Neural networks are a way of parametrizing non-linear functions. Usually, the training of a neural network is done via different variants of gradient descent, i.e. trying to find a good choice of weights by minimizing the loss function.

What we do here in this notebook is another approach: instead of using a gradient based method that does the fitting of the network, we want to apply the particle swarm optimization and Nelder Mead algorithms to find a good choice of weights. Our application is classical binary classification. The discussion includes:

  • Our own implementation of a neural net, forward propagation and loss function
  • An interactive example and visualization for binary classification, where one can choose different hyperparameters
  • Usability and performance of these optimizers for neural net training

Developing

All notebooks depend on and use Matplotlib, NumPy, PySwarms, Sklearn, and SciPy. The Python version used is 3.8. See requirements.txt.

Please consider the rule to always push your changes to the notebook only AFTER restarting the kernel and executing all cells starting from the first to ensure a working notebook.

Bonus

Credits

Credits belong to:

License

All code in this repository is published under the terms of the MIT License

© July 2020 Alexander Haegele, Richard von der Horst, Paul Elvinger

swarm's People

Contributors

haeggee avatar richardvdh avatar elvingerpaul avatar

Stargazers

Ashish Patel avatar

Watchers

 avatar

swarm's Issues

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.