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: Evaluate the individual on the test set to get fitness scores 
docstr_tok: ["Evaluate","the","individual","on","the","test","set","to","get","fitness","scores"]
code: def _calculate_fitness(self, individual):
      """Evaluate the individual on the test set to get fitness scores"""
      loss, acc = individual.test_on_batch(self.X, self.y)
      individual.fitness = 1 / (loss + 1e-8)
      individual.accuracy = acc
  
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 5 for calling the ParticleSwarmOptimizedNN obj's underlying member method code with example usage: obj._calculate_fitness(individual) without return types