class_docstr: Black Box Variational Inference - minibatch
  
  Parameters
  ----------
  neg_posterior : function
      posterior function
  
  full_neg_posterior : function
      posterior function
  
  q : List
      list holding distribution objects
  
  sims : int
      Number of Monte Carlo sims for the gradient
  
  step : float
      Step size for RMSProp
  
  iterations: int
      How many iterations to run
  
  mini_batch : int
      Mini batch size
  
  record_elbo : boolean
      Whether to record the ELBO
  
  quiet_progress : boolean
      Whether to print progress or stay quiet
docstr: The core BBVI routine - draws Monte Carlo gradients and uses a stochastic optimizer.
docstr_tok: ["The","core","BBVI","routine","-","draws","Monte","Carlo","gradients","and","uses","a","stochastic","optimizer","."]
code: def run(self):
      """
      The core BBVI routine - draws Monte Carlo gradients and uses a stochastic optimizer.
      """
  
      # Initialization assumptions
      z = self.draw_normal_initial()
      gradient = self.cv_gradient_initial(z)
      gradient[np.isnan(gradient)] = 0
      variance = np.power(gradient, 2)
      final_parameters = self.current_parameters()
      final_samples = 1
  
      # Create optimizer
      if self.optimizer == "ADAM":
          self.optim = ADAM(
              final_parameters, variance, self.learning_rate, 0.9, 0.999
          )
      elif self.optimizer == "RMSProp":
          self.optim = RMSProp(
              final_parameters, variance, self.learning_rate, 0.99
          )
  
      # Record elbo
      if self.record_elbo is True:
          elbo_records = np.zeros(self.iterations)
      else:
          elbo_records = None
  
      for i in range(self.iterations):
          x = self.draw_normal()
          gradient = self.cv_gradient(x)
          gradient[np.isnan(gradient)] = 0
          self.change_parameters(self.optim.update(gradient))
  
          if self.printer is True:
              self.print_progress(i, self.optim.parameters[::2])
  
          # Construct final parameters using final 10% of samples
          if i > self.iterations - round(self.iterations / 10):
              final_samples += 1
              final_parameters = (
                  final_parameters + self.optim.parameters
              )
  
          if self.record_elbo is True:
              elbo_records[i] = self.get_elbo(
                  self.optim.parameters[::2]
              )
  
      final_parameters = final_parameters / float(final_samples)
      self.change_parameters(final_parameters)
      final_means = np.array(
          [
              final_parameters[el]
              for el in range(len(final_parameters))
              if el % 2 == 0
          ]
      )
      final_ses = np.array(
          [
              final_parameters[el]
              for el in range(len(final_parameters))
              if el % 2 != 0
          ]
      )
      if not self.quiet_progress:
          print("")
          print(
              "Final model ELBO is "
              + str(
                  -self.full_neg_posterior(final_means)
                  - self.create_normal_logq(final_means)
              )
          )
      return self.q, final_means, final_ses, elbo_records
  
imports: import sys
  import numpy
  import scipy.stats
  from .stoch_optim import RMSProp, ADAM
  from .bbvi_routines import alpha_recursion, log_p_posterior, mb_log_p_posterior
label_desc: Use image node_id 5 for calling the BBVIM obj's underlying member method code with example usage: obj.run() and returns: self,  final_means,  final_ses,  elbo_records