docstr: Update weights of the model in the numpy level.
  
  Compute the grident and take a step.
  
  Args:
      noisy_rewards(np.float32): [batch_size, 2]
      noises(np.float32): [batch_size, weights_total_size]
docstr_tok: ["Update","weights","of","the","model","in","the","numpy","level",".","Compute","the","grident","and","take","a","step",".","Args",":","noisy_rewards","(","np.float32",")",":","[","batch_size",",","2","]","noises","(","np.float32",")",":","[","batch_size",",","weights_total_size","]"]
code: def learn(self, noisy_rewards, noises):
      """Update weights of the model in the numpy level.
  
      Compute the grident and take a step.
  
      Args:
          noisy_rewards(np.float32): [batch_size, 2]
          noises(np.float32): [batch_size, weights_total_size]
      """
  
      g = utils.batched_weighted_sum(
          # mirrored sampling: evaluate pairs of perturbations \epsilon, −\epsilon
          noisy_rewards[:, 0] - noisy_rewards[:, 1],
          noises,
          batch_size=500,
      )
      g /= noisy_rewards.size
  
      latest_flat_weights = self.get_flat_weights()
      # Compute the new weights theta.
      theta, update_ratio = self.optimizer.update(
          latest_flat_weights,
          -g + self.config["l2_coeff"] * latest_flat_weights,
      )
      self.set_flat_weights(theta)
  
file_path: PARL/benchmark/fluid/ES/mujoco_agent.py
imports: import numpy
  import paddle.fluid
  import parl
  import utils
  from parl import layers
  from optimizers import Adam
label_desc: Use image node_id 3 for calling the MujocoAgent obj's underlying member method code with example usage: obj.learn(noisy_rewards, noises) without return types