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 
docstr: Returns a new individual 
docstr_tok: ["Returns","a","new","individual"]
code: def _build_model(self, id):
      """Returns a new individual"""
      model = self.model_builder(
          n_inputs=self.X.shape[1], n_outputs=self.y.shape[1]
      )
      model.id = id
      model.fitness = 0
      model.highest_fitness = 0
      model.accuracy = 0
      # Set intial best as the current initialization
      model.best_layers = copy.copy(model.layers)
  
      # Set initial velocity to zero
      model.velocity = []
      for layer in model.layers:
          velocity = {"W": 0, "w0": 0}
          if hasattr(layer, "W"):
              velocity = {
                  "W": np.zeros_like(layer.W),
                  "w0": np.zeros_like(layer.w0),
              }
          model.velocity.append(velocity)
  
      return model
  
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 2 for calling the ParticleSwarmOptimizedNN obj's underlying member method code with example usage: obj._build_model(id) and returns: model