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: Receive trial's result. if the number of finished trials equals self.inf_batch_size, start the next update to
  train the model.
  
  Parameters
  ----------
  parameter_id : int
      Unique identifier of used hyper-parameters, same with :meth:`generate_parameters`.
  parameters : dict
      Hyper-parameters generated by :meth:`generate_parameters`.
  value : dict
      Result from trial (the return value of :func:`nni.report_final_result`).
docstr_tok: ["Receive","trial","'s","result",".","if","the","number","of","finished","trials","equals","self.inf_batch_size",",","start","the","next","update","to","train","the","model",".","Parameters","--","--","--","--","--","parameter_id",":","int","Unique","identifier","of","used","hyper-parameters",",","same","with",":","meth",":","`","generate_parameters","`",".","parameters",":","dict","Hyper-parameters","generated","by",":","meth",":","`","generate_parameters","`",".","value",":","dict","Result","from","trial","(","the","return","value","of",":","func",":","`","nni.report_final_result","`",")","."]
code: def receive_trial_result(
      self, parameter_id, parameters, value, **kwargs
  ):
      """
      Receive trial's result. if the number of finished trials equals self.inf_batch_size, start the next update to
      train the model.
  
      Parameters
      ----------
      parameter_id : int
          Unique identifier of used hyper-parameters, same with :meth:`generate_parameters`.
      parameters : dict
          Hyper-parameters generated by :meth:`generate_parameters`.
      value : dict
          Result from trial (the return value of :func:`nni.report_final_result`).
      """
      trial_info_idx = self.running_trials.pop(parameter_id, None)
      assert trial_info_idx is not None
  
      value = extract_scalar_reward(value)
      if self.optimize_mode == OptimizeMode.Minimize:
          value = -value
  
      self.trials_result[trial_info_idx] = value
      self.finished_trials += 1
  
      logger.debug(
          "receive_trial_result, parameter_id %d, trial_info_idx %d, finished_trials %d, inf_batch_size %d",
          parameter_id,
          trial_info_idx,
          self.finished_trials,
          self.inf_batch_size,
      )
      if self.finished_trials == self.inf_batch_size:
          logger.debug(
              "Start next round inference in receive_trial_result"
          )
          self._next_round_inference()
  
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 9 for calling the PPOTuner obj's underlying member method code with example usage: obj.receive_trial_result(parameter_id, parameters, value) without return types