class_docstr: PPOTuner, the implementation inherits the main logic of the implementation
  `ppo2 from openai <https://github.com/openai/baselines/tree/master/baselines/ppo2>`__ and is adapted for NAS scenario.
  It uses ``lstm`` for its policy network and value network, policy and value share the same network.
  
  Parameters
  ----------
  optimize_mode : str
      maximize or minimize
  trials_per_update : int
      Number of trials to have for each model update
  epochs_per_update : int
      Number of epochs to run for each model update
  minibatch_size : int
      Minibatch size (number of trials) for the update
  ent_coef : float
      Policy entropy coefficient in the optimization objective
  lr : float
      Learning rate of the model (lstm network), constant
  vf_coef : float
      Value function loss coefficient in the optimization objective
  max_grad_norm : float
      Gradient norm clipping coefficient
  gamma : float
      Discounting factor
  lam : float
      Advantage estimation discounting factor (lambda in the paper)
  cliprange : float
      Cliprange in the PPO algorithm, constant
class_docstr_tok: ["PPOTuner",",","the","implementation","inherits","the","main","logic","of","the","implementation","`","ppo2","from","openai","<","https",":","\/\/github.com\/openai\/baselines\/tree\/master\/baselines\/ppo2",">","`","__","and","is","adapted","for","NAS","scenario",".","It","uses","``","lstm","``","for","its","policy","network","and","value","network",",","policy","and","value","share","the","same","network",".","Parameters","--","--","--","--","--","optimize_mode",":","str","maximize","or","minimize","trials_per_update",":","int","Number","of","trials","to","have","for","each","model","update","epochs_per_update",":","int","Number","of","epochs","to","run","for","each","model","update","minibatch_size",":","int","Minibatch","size","(","number","of","trials",")","for","the","update","ent_coef",":","float","Policy","entropy","coefficient","in","the","optimization","objective","lr",":","float","Learning","rate","of","the","model","(","lstm","network",")",",","constant","vf_coef",":","float","Value","function","loss","coefficient","in","the","optimization","objective","max_grad_norm",":","float","Gradient","norm","clipping","coefficient","gamma",":","float","Discounting","factor","lam",":","float","Advantage","estimation","discounting","factor","(","lambda","in","the","paper",")","cliprange",":","float","Cliprange","in","the","PPO","algorithm",",","constant"]
docstr: Generate parameters, if no trial configration for now, self.credit plus 1 to send the config later
  
  Parameters
  ----------
  parameter_id : int
      Unique identifier for requested hyper-parameters.
      This will later be used in :meth:`receive_trial_result`.
  **kwargs
      Not used
  
  Returns
  -------
  dict
      One newly generated configuration
docstr_tok: ["Generate","parameters",",","if","no","trial","configration","for","now",",","self.credit","plus","1","to","send","the","config","later","Parameters","--","--","--","--","--","parameter_id",":","int","Unique","identifier","for","requested","hyper-parameters",".","This","will","later","be","used","in",":","meth",":","`","receive_trial_result","`",".","*","*","kwargs","Not","used","Returns","--","--","--","-","dict","One","newly","generated","configuration"]
code: def generate_parameters(self, parameter_id, **kwargs):
      """
      Generate parameters, if no trial configration for now, self.credit plus 1 to send the config later
  
      Parameters
      ----------
      parameter_id : int
          Unique identifier for requested hyper-parameters.
          This will later be used in :meth:`receive_trial_result`.
      **kwargs
          Not used
  
      Returns
      -------
      dict
          One newly generated configuration
  
      """
      if self.first_inf:
          self.trials_result = [
              None for _ in range(self.inf_batch_size)
          ]
          (
              mb_obs,
              mb_actions,
              mb_values,
              mb_neglogpacs,
              mb_dones,
              last_values,
          ) = self.model.inference(self.inf_batch_size)
          self.trials_info = TrialsInfo(
              mb_obs,
              mb_actions,
              mb_values,
              mb_neglogpacs,
              mb_dones,
              last_values,
              self.inf_batch_size,
          )
          self.first_inf = False
  
      trial_info_idx, actions = self.trials_info.get_next()
      if trial_info_idx is None:
          logger.debug("Credit added by one in parameters request")
          self.credit += 1
          self.param_ids.append(parameter_id)
          raise nni.NoMoreTrialError("no more parameters now.")
  
      self.running_trials[parameter_id] = trial_info_idx
      new_config = self._actions_to_config(actions)
      return new_config
  
imports: import copy
  import logging
  import numpy
  from gym import spaces
  from schema import Schema, Optional
  import nni
  from nni import ClassArgsValidator
  from nni.tuner import Tuner
  from nni.utils import OptimizeMode, extract_scalar_reward
  from .model import Model
  from .util import set_global_seeds
  from .policy import build_lstm_policy
label_desc: Use image node_id 7 for calling the PPOTuner obj's underlying member method code with example usage: obj.generate_parameters(parameter_id) and returns: new_config