code: def test_bayesian_optimizer_its_random_mutation_discrete(self):
      acq_type = "its"
      mutation_type = "random"
      input_param = discrete_input_param()
      gt_net = create_ground_truth_net(input_param)
      obj_func = create_discrete_choice_obj_func(input_param, gt_net)
      optimizer = BayesianOptimizerBase(
          param=input_param,
          obj_func=obj_func,
          start_temp=1.0,
          min_temp=0.0,
          acq_type=acq_type,
          mutation_type=mutation_type,
      )
      sampled_solution = {
          "choice1": torch.tensor([0]),
          "choice2": torch.tensor([1]),
          "choice3": torch.tensor([0]),
          "choice4": torch.tensor([1]),
          "choice5": torch.tensor([0]),
      }
      optimizer._maintain_best_solutions(
          sampled_solution, torch.tensor([0.0])
      )
      # no mutation
      mutated_solution = optimizer.sample(1, 0.0)
      self.assertEqual(sampled_solution, mutated_solution)
      # mutation in one idx (at most)
      mutated_solution = optimizer.sample(1, 1 / len(input_param))
      difference = 0
      for k in sorted(input_param.keys()):
          if sampled_solution[k] != mutated_solution[k]:
              difference += 1
      self.assertTrue(difference <= 1)
      # mutation in two idxs (at most)
      mutated_solution = optimizer.sample(1, 2 / len(input_param))
      difference = 0
      for k in sorted(input_param.keys()):
          if sampled_solution[k] != mutated_solution[k]:
              difference += 1
      self.assertTrue(difference <= 2)
  
imports: import random
  import unittest
  from collections import defaultdict
  from typing import Dict
  import nevergrad
  import numpy
  import torch
  import torch.nn
  from reagent.lite.optimizer import BayesianByBackpropOptimizer, BayesianMLPEnsemblerOptimizer, BayesianOptimizerBase, GREEDY_TEMP, GumbelSoftmaxOptimizer, NeverGradOptimizer, PolicyGradientOptimizer, QLearningOptimizer, RandomSearchOptimizer, sol_to_tensors
label_desc: Use image node_id 13 for calling the TestComboOptimizer obj's underlying member method code with example usage: obj.test_bayesian_optimizer_its_random_mutation_discrete() without return types