class_docstr: Use neural networks as an alternative to GPs to model distributions over functions in bayesian optimization.
  
  Parameters
  ----------
  optimize : maximize | minimize, default = maximize
      If 'maximize', the tuner will target to maximize metrics. If 'minimize', the tuner will target to minimize metrics.
  sample_size : int, default = 1000
      Number of samples to select in each iteration. The best one will be picked from the samples as the next trial.
  trials_per_update : int, default = 20
      Number of trials to collect before updating the model.
  num_epochs_per_training : int, default = 500
      Number of epochs to train DNGO model.
code: def generate_parameters(self, parameter_id, **kwargs):
      if not self._model_initialized:
          return _random_config(
              self.searchspace_json, self.random_state
          )
      else:
          # random samples and pick best with model
          candidate_x = [
              _random_config(self.searchspace_json, self.random_state)
              for _ in range(self.sample_size)
          ]
  
          # The model has NaN issue when all the candidates are same
          # Also we can save the predict time when this happens
          if all(x == candidate_x[0] for x in candidate_x):
              return candidate_x[0]
  
          x_test = np.array(
              [np.array(list(xi.values())) for xi in candidate_x]
          )
          m, v = self.model.predict(x_test)
  
          # The model has NaN issue when all the candidates are very close
          if np.isnan(m).any() or np.isnan(v).any():
              return candidate_x[0]
  
          mean = torch.Tensor(m)
          sigma = torch.Tensor(v)
          u = (mean - torch.Tensor([0.95]).expand_as(mean)) / sigma
          normal = Normal(torch.zeros_like(u), torch.ones_like(u))
          ucdf = normal.cdf(u)
          updf = torch.exp(normal.log_prob(u))
          ei = sigma * (updf + u * ucdf)
  
          if self.optimize_mode == "maximize":
              ind = torch.argmax(ei)
          else:
              ind = torch.argmin(ei)
          new_x = candidate_x[ind]
          return new_x
  
imports: import logging
  import warnings
  import numpy
  import torch
  from pybnn import DNGO
  from torch.distributions import Normal
  import nni.parameter_expressions
  from nni import ClassArgsValidator
  from nni.common.hpo_utils import validate_search_space
  from nni.tuner import Tuner
label_desc: Use image node_id 3 for calling the DNGOTuner obj's underlying member method code with example usage: obj.generate_parameters(parameter_id) and returns: _random_config, new_x, candidate_x, candidate_x