class_docstr: Model that does training one microbatch at a time - when gradient computation
  on the entire minibatch causes some overflow
class_docstr_tok: ["Model","that","does","training","one","microbatch","at","a","time","-","when","gradient","computation","on","the","entire","minibatch","causes","some","overflow"]
code: def __init__(
      self,
      *,
      policy,
      ob_space,
      ac_space,
      nbatch_act,
      nbatch_train,
      nsteps,
      ent_coef,
      vf_coef,
      max_grad_norm,
      mpi_rank_weight,
      comm,
      microbatch_size,
  ):
      self.nmicrobatches = nbatch_train // microbatch_size
      self.microbatch_size = microbatch_size
      assert (
          nbatch_train % microbatch_size == 0
      ), "microbatch_size ({}) should divide nbatch_train ({}) evenly".format(
          microbatch_size, nbatch_train
      )
  
      super().__init__(
          policy=policy,
          ob_space=ob_space,
          ac_space=ac_space,
          nbatch_act=nbatch_act,
          nbatch_train=microbatch_size,
          nsteps=nsteps,
          ent_coef=ent_coef,
          vf_coef=vf_coef,
          max_grad_norm=max_grad_norm,
          mpi_rank_weight=mpi_rank_weight,
          comm=comm,
      )
  
      self.grads_ph = [
          tf.placeholder(dtype=g.dtype, shape=g.shape)
          for g in self.grads
      ]
      grads_ph_and_vars = list(zip(self.grads_ph, self.var))
      self._apply_gradients_op = self.trainer.apply_gradients(
          grads_ph_and_vars
      )
  
imports: import tensorflow
  import numpy
  from baselines.ppo2.model import Model
label_desc: Use image node_id 1 to create a new MicrobatchedModel object from inherited base classes: Model with example: obj = MicrobatchedModel()