class_docstr: Abstract baseclass of an optimizer to be used with ES.
docstr: Execute one update step.
  
  :param global_gradient: A flat gradient vector
  
  :return update ratio = norm(optimizer step) / norm(theta)
docstr_tok: ["Execute","one","update","step",".",":","param","global_gradient",":","A","flat","gradient","vector",":","return","update","ratio","=","norm","(","optimizer","step",")","\/","norm","(","theta",")"]
code: def update(self, global_gradient: np.ndarray) -> float:
      """Execute one update step.
  
      :param global_gradient: A flat gradient vector
  
      :return update ratio = norm(optimizer step) / norm(theta)
      """
      self.t += 1
      step = self._compute_step(global_gradient)
      theta = get_flat_parameters(self.policy)
      ratio = np.linalg.norm(step) / np.linalg.norm(theta)
      set_flat_parameters(self.policy, theta + step)
      return ratio
  
file_path: maze/maze/train/trainers/es/optimizers/base_optimizer.py
imports: from abc import ABC, abstractmethod
  from typing import Optional
  import numpy
  from maze.core.agent.torch_model import TorchModel
  from maze.train.trainers.es.es_utils import get_flat_parameters, set_flat_parameters
label_desc: Use image node_id 3 for calling the Optimizer obj's underlying member method code with example usage: obj.update(global_gradient) and returns: ratio