docstr: Fast Moving Natural Evolution Strategy 
  for High-Dimensional Problems (CR-FM-NES), see https://arxiv.org/abs/2201.11422 .
  Derived from https://github.com/nomuramasahir0/crfmnes
docstr_tok: ["Fast","Moving","Natural","Evolution","Strategy","for","High-Dimensional","Problems","(","CR-FM-NES",")",",","see","https",":","\/\/arxiv.org\/abs\/2201.11422",".","Derived","from","https",":","\/\/github.com\/nomuramasahir0\/crfmnes"]
code: def __init__(
      self,
      num_dims: int,
      popsize: int,
      mean: Optional[Union[jnp.ndarray, np.ndarray]],
      input_sigma: float,
      rng: jax.random.PRNGKey,
  ):
      """Fast Moving Natural Evolution Strategy
      for High-Dimensional Problems (CR-FM-NES), see https://arxiv.org/abs/2201.11422 .
      Derived from https://github.com/nomuramasahir0/crfmnes"""
      if popsize % 2 == 1:  # requires even popsize
          popsize += 1
      self.lamb = popsize
      self.dim = num_dims
      self.sigma = input_sigma
      self.rng = rng
      self.m = jnp.array([mean]).T
      self.v = jax.random.normal(rng, (self.dim, 1)) / jnp.sqrt(
          self.dim
      )
      self.D = jnp.ones([self.dim, 1])
  
      self.w_rank_hat = (
          jnp.log(self.lamb / 2 + 1)
          - jnp.log(jnp.arange(1, self.lamb + 1))
      ).reshape(self.lamb, 1)
      self.w_rank_hat = self.w_rank_hat.at[
          jnp.where(self.w_rank_hat < 0)
      ].set(0)
      self.w_rank = self.w_rank_hat / sum(self.w_rank_hat) - (
          1.0 / self.lamb
      )
      self.mueff = float(
          1
          / jnp.dot(
              (self.w_rank + (1 / self.lamb)).T,
              (self.w_rank + (1 / self.lamb)),
          )[0][0]
      )
  
      self.cs = (self.mueff + 2.0) / (self.dim + self.mueff + 5.0)
      self.cc = (4.0 + self.mueff / self.dim) / (
          self.dim + 4.0 + 2.0 * self.mueff / self.dim
      )
      self.c1_cma = 2.0 / (math.pow(self.dim + 1.3, 2) + self.mueff)
      # initialization
      self.chiN = math.sqrt(self.dim) * (
          1.0
          - 1.0 / (4.0 * self.dim)
          + 1.0 / (21.0 * self.dim * self.dim)
      )
      self.pc = jnp.zeros((self.dim, 1))
      self.ps = jnp.zeros((self.dim, 1))
      # distance weight parameter
      self.h_inv = get_h_inv(self.dim)
      self.alpha_dist = (
          lambda lambF: self.h_inv
          * min(1.0, math.sqrt(self.lamb / self.dim))
          * math.sqrt(lambF / self.lamb)
      )
      self.w_dist_hat = lambda z, lambF: exp(
          self.alpha_dist(lambF) * jnp.linalg.norm(z)
      )
      # learning rate
      self.eta_m = 1.0
      self.eta_move_sigma = 1.0
      self.eta_stag_sigma = lambda lambF: math.tanh(
          (0.024 * lambF + 0.7 * self.dim + 20.0) / (self.dim + 12.0)
      )
      self.eta_conv_sigma = lambda lambF: 2.0 * math.tanh(
          (0.025 * lambF + 0.75 * self.dim + 10.0) / (self.dim + 4.0)
      )
      self.c1 = (
          lambda lambF: self.c1_cma
          * (self.dim - 5)
          / 6
          * (lambF / self.lamb)
      )
      self.eta_B = lambda lambF: jnp.tanh(
          (min(0.02 * lambF, 3 * jnp.log(self.dim)) + 5)
          / (0.23 * self.dim + 25)
      )
  
      self.g = 0
      self.no_of_evals = 0
      self.iteration = 0
      self.stop = 0
  
      self.idxp = jnp.arange(self.lamb / 2, dtype=int)
      self.idxm = jnp.arange(self.lamb / 2, self.lamb, dtype=int)
      self.z = jnp.zeros([self.dim, self.lamb])
  
      self.f_best = float("inf")
      self.x_best = jnp.empty(self.dim)
  
imports: import math
  import numpy
  from typing import Union
  from typing import Optional
  import logging
  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 CRFM object  with example: obj = CRFM(num_dims, popsize, mean, input_sigma, rng)