class_docstr: Evolutionary optimization of Neural Networks.
  
  Parameters:
  -----------
  n_individuals: int
      The number of neural networks that are allowed in the population at a time.
  mutation_rate: float
      The probability that a weight will be mutated.
  model_builder: method
      A method which returns a user specified NeuralNetwork instance. 
class_docstr_tok: ["Evolutionary","optimization","of","Neural","Networks",".","Parameters",":","--","--","--","--","--","-","n_individuals",":","int","The","number","of","neural","networks","that","are","allowed","in","the","population","at","a","time",".","mutation_rate",":","float","The","probability","that","a","weight","will","be","mutated",".","model_builder",":","method","A","method","which","returns","a","user","specified","NeuralNetwork","instance","."]
docstr: Copies the weights from parent to child 
docstr_tok: ["Copies","the","weights","from","parent","to","child"]
code: def _inherit_weights(self, child, parent):
      """Copies the weights from parent to child"""
      for i in range(len(child.layers)):
          if hasattr(child.layers[i], "W"):
              # The child inherits both weights W and bias weights w0
              child.layers[i].W = parent.layers[i].W.copy()
              child.layers[i].w0 = parent.layers[i].w0.copy()
  
file_path: ML-From-Scratch/mlfromscratch/supervised_learning/neuroevolution.py
imports: from __future__ import print_function, division
  import numpy
  import copy
label_desc: Use image node_id 5 for calling the Neuroevolution obj's underlying member method code with example usage: obj._inherit_weights(child, parent) without return types