class_docstr: A wrapper of CMA-ES.
class_docstr_tok: ["A","wrapper","of","CMA-ES","."]
code: def __init__(
      self,
      param_size: int,
      pop_size: int,
      init_stdev: float = 0.1,
      seed: int = 0,
      logger: logging.Logger = None,
  ):
      if logger is None:
          self.logger = create_logger(name="CMA")
      else:
          self.logger = logger
      self.pop_size = pop_size
  
      try:
          import cma
      except ModuleNotFoundError:
          print("You need to install cma for its CMA-ES:")
          print("  pip install cma")
          sys.exit(1)
  
      self.cma = cma.CMAEvolutionStrategy(
          x0=np.zeros(param_size),
          sigma0=init_stdev,
          inopts={
              "popsize": pop_size,
              "seed": seed if seed > 0 else 42,
              "randn": np.random.randn,
          },
      )
      self.params = None
      self._best_params = None
  
      self.jnp_array = jax.jit(jnp.array)
      self.jnp_stack = jax.jit(jnp.stack)
  
file_path: evojax/evojax/algo/cma_wrapper.py
imports: import sys
  import logging
  import numpy
  from typing import Union
  import jax
  import jax.numpy
  from evojax.algo.base import NEAlgorithm
  from evojax.util import create_logger
label_desc: Use image node_id 1 to create a new CMA object from inherited base classes: NEAlgorithm with example: obj = CMA(param_size, pop_size, init_stdev, seed, logger)