class_docstr: Particle Swarm Optimization of Neural Network.
  
  Parameters:
  -----------
  n_individuals: int
      The number of neural networks that are allowed in the population at a time.
  model_builder: method
      A method which returns a user specified NeuralNetwork instance.
  inertia_weight:     float [0,1)
  cognitive_weight:   float [0,1)
  social_weight:      float [0,1)
  max_velocity: float
      The maximum allowed value for the velocity.
  
  Reference:
      Neural Network Training Using Particle Swarm Optimization
      https://visualstudiomagazine.com/articles/2013/12/01/neural-network-training-using-particle-swarm-optimization.aspx 
code: def __init__(
      self,
      population_size,
      model_builder,
      inertia_weight=0.8,
      cognitive_weight=2,
      social_weight=2,
      max_velocity=20,
  ):
      self.population_size = population_size
      self.model_builder = model_builder
      self.best_individual = None
      # Parameters used to update velocity
      self.cognitive_w = cognitive_weight
      self.inertia_w = inertia_weight
      self.social_w = social_weight
      self.min_v = -max_velocity
      self.max_v = max_velocity
  
file_path: ML-From-Scratch/mlfromscratch/supervised_learning/particle_swarm_optimization.py
imports: from __future__ import print_function, division
  import numpy
  import copy
label_desc: Use image node_id 1 to create a new ParticleSwarmOptimizedNN object  with example: obj = ParticleSwarmOptimizedNN(population_size, model_builder, inertia_weight, cognitive_weight, social_weight, max_velocity)