Hi guys I've been studying such combination where the idea is to replace the classic descendant gradient for an algorithm that is less sensitive to local optimum, so the PSO tries to select the best weight and bias for the model.

But I've seen everywhere that only one hidden layer is used (no one explains why just one layer is being used) and all those codes break when I try to use more than one hidden layer, so the questions are:

  1. Can't PSO be used to optimize an Artificial Neural Network with more than one hidden layer?

  2. In that case, why is that?


Particle Swarm Optimization can be used to optimize a neural network with more than one hidden layer. Instead of optimizing a single weight matrix, and two bias vectors, you are just optimizing more of them. However, PSO is not often used for larger neural networks, because, particle swarm optimization is not all that efficient at working with a large amount of data, which you need to train larger neural networks. Particle Swarm Optimization involves taking many particles, and evaluating the fitness in all of them. If you have let’s say 1,000,000 training examples, you are doing a lot more error calculations, even if you used a small batch size, than if you used another technique lake Backproppogation, or a related technique. Backproppogation and related techniques are used much more in larger neural networks because they are more efficient at working with larger sets of data. As for why the code that you have been using breaks with networks with more than one hidden layer, I cannot explain, but it is fairly easy to write your own basic implementation of PSO to train multi layer neural networks.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.