Reader small image

You're reading from  Hands-On Neural Network Programming with C#

Product typeBook
Published inSep 2018
Reading LevelIntermediate
PublisherPackt
ISBN-139781789612011
Edition1st Edition
Languages
Right arrow
Author (1)
Matt Cole
Matt Cole
author image
Matt Cole

Matt R. Cole is a developer and author with 30 years' experience. Matt is the owner of Evolved AI Solutions, a provider of advanced Machine Learning/Bio-AI, Microservice and Swarm technologies. Matt is recognized as a leader in Microservice and Artificial Intelligence development and design. As an early pioneer of VOIP, Matt developed the VOIP system for NASA for the International Space Station and Space Shuttle. Matt also developed the first Bio Artificial Intelligence framework which completely integrates mirror and canonical neurons. In his spare time Matt authors books, and continues his education taking every available course in advanced mathematics, AI/ML/DL, Quantum Mechanics/Physics, String Theory and Computational Neuroscience.
Read more about Matt Cole

Right arrow

Finding Optimal Parameters

In this chapter, we will use the open source package SwarmOps, version 4.0, to help you better understand how you can use this tool to find optimal parameters for your functions. You can get the latest version of SwarmOps from the following location: https://github.com/mattcolefla/SwarmOps.

Once again, we must spend a little time on theory, where we will take you back to your academic days and lay a foundation so that we are all speaking the same language. It should be noted that SwarmOps is a highly research-oriented tool and should be used as such. We have worked hard to make this product open source, and the latest version has over 60 different optimization functions for you to use.

This chapter will cover the following topics:

  • Fitness function
  • Constraints
  • Meta-optimization
  • Optimization methods
  • Parallelism

Ready? Here we go!

...

Technical requirements

You will be required to have a basic knowledge of .NET development using Microsoft Visual Studio and C#. You will need to download the code for this chapter from the book's website: SwarmOps (https://github.com/mattcolefla/SwarmOps).

Check out the following video to see Code in Action: http://bit.ly/2QPddLO.

Optimization

Solutions to some problems are not as cut and dry as correct or incorrect, but are rated in terms of quality. Such problems are known as optimization problems because the goal is to find the candidate solution with the best, that is, optimal quality.

What is a fitness function?

SwarmOps works for real-valued and single-objective optimization problems, that is, optimization problems that map candidate solutions from -dimensional real-valued spaces to one-dimensional real-valued spaces. Mathematically speaking, we consider optimization problems to be functions of the following form:

In SwarmOps, it is assumed that is a minimization problem, meaning that we are searching for the candidate solution with the smallest...

Optimization methods

This section will give you a brief description of the optimization methods that are supplied with SwarmOps and some recommendations for their use.

Choosing an optimizer

When faced with a new optimization problem, the first optimizer you may want to try is the PS method, which is often sufficient and has the advantage of converging (or stagnating) very quickly. In addition, PS does not have any behavioral parameters that need tuning, so it either works or it doesn't. If the PS method fails at optimizing your problem, you may want to try the LUS method. You may need to run both PS and LUS several times as they may converge to sub-optimal solutions. If PS and LUS both fail, you may try the DE, MOL, or...

Parallelism

Computers with multiple processing units are becoming increasingly popular and there are different ways of using this parallelism.

Parallelizing the optimization problem

Some optimization problems can be parallelized internally. The advantage of this is that all optimization methods in SwarmOps can be used without modification. The disadvantage is that each optimization problem must be parallelized, and this process does not take advantage of the natural parallel structure of population-based optimizers.

Parallel optimization methods

SwarmOps provides parallelized...

Summary

In this chapter, we learned how to use SwarmOps to help us optimize parameters for our function optimization. We learned how to use the built-in functions of SwarmOps, as well as how to define our own. In the next chapter, we will move on to image detection and will use the great open source package, TensorFlowSharp.

References

  • J. Kennedy and R. Eberhart. Particle swarm optimization in Proceedings of IEEE International Conference on Neural Networks, volume IV, pages 1942-1948, Pert, Australia, 1995
  • Y. Shi and R.C. Eberhart. A modified particle swarm optimizer. In Proceedings of the IEEE International Conference on Evolutionary Computation, pages 69-73, Anchorage, AK, USA, 1998.
  • J. Kennedy. The particle swarm: social adaptation of knowledge. In Proceedings of the IEEE International Conference on Evolutionary Computation, Indianapolis, USA, 1997.
  • M.E.H Pederson and A.J. Chipperfield. Simplified particle swarm optimization. Applied Soft Computing, 10, P. 618-628, 2010.
  • Simplifying Particle Swarm Optimization. Pedersen, M.E.H. and Chipperfield, A.J. s.l. : Applied Soft Computing, 2010, Vol. 10, pp. 618-628.
  • Variable metric method for minimization. Davidon, W.C. 1, s.l. : SIAM Journal on Optimization...
lock icon
The rest of the chapter is locked
You have been reading a chapter from
Hands-On Neural Network Programming with C#
Published in: Sep 2018Publisher: PacktISBN-13: 9781789612011
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Matt Cole

Matt R. Cole is a developer and author with 30 years' experience. Matt is the owner of Evolved AI Solutions, a provider of advanced Machine Learning/Bio-AI, Microservice and Swarm technologies. Matt is recognized as a leader in Microservice and Artificial Intelligence development and design. As an early pioneer of VOIP, Matt developed the VOIP system for NASA for the International Space Station and Space Shuttle. Matt also developed the first Bio Artificial Intelligence framework which completely integrates mirror and canonical neurons. In his spare time Matt authors books, and continues his education taking every available course in advanced mathematics, AI/ML/DL, Quantum Mechanics/Physics, String Theory and Computational Neuroscience.
Read more about Matt Cole