class_docstr: Differential evolution.
  
  Default pop size equal to 30
  We return the mean of the individuals with fitness better than median, which might be stupid sometimes.
  CR =.5, F1=.8, F2=.8, curr-to-best.
  Initial population: pure random.
class_docstr_tok: ["Differential","evolution",".","Default","pop","size","equal","to","30","We","return","the","mean","of","the","individuals","with","fitness","better","than","median",",","which","might","be","stupid","sometimes",".","CR","=.5",",","F1=.8",",","F2=.8",",","curr-to-best",".","Initial","population",":","pure","random","."]
code: def __init__(
      self,
      parametrization: base.IntOrParameter,
      budget: tp.Optional[int] = None,
      num_workers: int = 1,
      config: tp.Optional["DifferentialEvolution"] = None,
      weights: tp.Any = None,
  ) -> None:
      super().__init__(
          parametrization, budget=budget, num_workers=num_workers
      )
      # config
      self.objective_weights = weights
      self._config = (
          DifferentialEvolution() if config is None else config
      )
      self.scale = (
          float(1.0 / np.sqrt(self.dimension))
          if isinstance(self._config.scale, str)
          else self._config.scale
      )
      pop_choice = {
          "standard": 0,
          "small": 1 + int(np.sqrt(np.log(self.dimension + 3))),
          "dimension": self.dimension + 1,
          "large": 7 * self.dimension,
      }
      if isinstance(self._config.popsize, int):
          self.llambda = self._config.popsize
      else:
          self.llambda = max(
              30, self.num_workers, pop_choice[self._config.popsize]
          )
      # internals
      # if budget is not None and budget < 60:
      #    warnings.warn(
      #        "DE algorithms are inefficient with budget < 60", base.errors.InefficientSettingsWarning
      #    )
      self._MULTIOBJECTIVE_AUTO_BOUND = max(self._MULTIOBJECTIVE_AUTO_BOUND, self.llambda)  # type: ignore
      self._penalize_cheap_violations = True
      self._uid_queue = base.utils.UidQueue()
      self.population: tp.Dict[str, p.Parameter] = {}
      self.sampler: tp.Optional[base.Optimizer] = None
      self._no_hypervolume = self._config.multiobjective_adaptation
  
imports: import warnings
  import numpy
  import nevergrad.common.typing
  from nevergrad.parametrization import parameter
  from .None import metamodel
  from .None import base
  from .None import oneshot
label_desc: Use image node_id 1 to create a new _DE object from inherited base classes: base with example: obj = _DE(parametrization, budget, num_workers, config, weights)