original_docstring: 
      Initializes the population with Latin Hypercube Sampling.
      Latin Hypercube Sampling ensures that each parameter is uniformly
      sampled over its range.
      
docstring: Initializes the population with Latin Hypercube Sampling.
  Latin Hypercube Sampling ensures that each parameter is uniformly
  sampled over its range.
docstring_tokens: Initializes the population with Latin Hypercube Sampling . Latin Hypercube Sampling ensures that each parameter is uniformly sampled over its range .
code: def init_population_lhs(self):
      """
      Initializes the population with Latin Hypercube Sampling.
      Latin Hypercube Sampling ensures that each parameter is uniformly
      sampled over its range.
      """
      rng = self.random_number_generator
  
      # Each parameter range needs to be sampled uniformly. The scaled
      # parameter range ([0, 1)) needs to be split into
      # `self.num_population_members` segments, each of which has the
      # following size:
      segsize = 1.0 / self.num_population_members
  
      # Within each segment we sample from a uniform random distribution.
      # We need to do this sampling for each parameter.
      samples = (segsize * rng.random_sample(self.population_shape)
  
                 # Offset each segment to cover the entire parameter range
                 # [0, 1)
                 + np.linspace(0., 1., self.num_population_members,
                               endpoint=False)[:, np.newaxis])
  
      # Create an array for population of candidate solutions.
      self.population = np.zeros_like(samples)
  
      # Initialize population of candidate solutions by permutation of the
      # random samples.
      for j in range(self.parameter_count):
        order = rng.permutation(range(self.num_population_members))
        self.population[:, j] = samples[order, j]
  
      # reset population energies
      self.population_energies = (np.ones(self.num_population_members) *
                                  np.inf)
  
      # reset number of function evaluations counter
      self._nfev = 0
code_tokens: def init_population_lhs ( self ) : rng = self . random_number_generator segsize = 1.0 / self . num_population_members samples = ( segsize * rng . random_sample ( self . population_shape ) + np . linspace ( 0. , 1. , self . num_population_members , endpoint = False ) [ : , np . newaxis ] ) self . population = np . zeros_like ( samples ) for j in range ( self . parameter_count ) : order = rng . permutation ( range ( self . num_population_members ) ) self . population [ : , j ] = samples [ order , j ] self . population_energies = ( np . ones ( self . num_population_members ) * np . inf ) self . _nfev = 0
short_docstring: Initializes the population with Latin Hypercube Sampling.
short_docstring_tokens: Initializes the population with Latin Hypercube Sampling .
comment: """
      Initializes the population with Latin Hypercube Sampling.
      Latin Hypercube Sampling ensures that each parameter is uniformly
      sampled over its range.
      """$SEP$# Each parameter range needs to be sampled uniformly. The scaled$SEP$# parameter range ([0, 1)) needs to be split into$SEP$# `self.num_population_members` segments, each of which has the$SEP$# following size:$SEP$# Within each segment we sample from a uniform random distribution.$SEP$# We need to do this sampling for each parameter.$SEP$# Offset each segment to cover the entire parameter range$SEP$# [0, 1)$SEP$# Create an array for population of candidate solutions.$SEP$# Initialize population of candidate solutions by permutation of the$SEP$# random samples.$SEP$# reset population energies$SEP$# reset number of function evaluations counter