class_docstr: log p(x) >= E_{q(z|x)}[ log p(x|z) + log p(z) - log q(z|x) ]
  p(z) = unif
  p(x|z) = N(x; mu_z, (kR_z'kR_z)^-1)
  q(z|x) = softmax(-0.5*(kR_z(x-mu_z))^2 +logdet(kR_z) -0.5d*log(2*pi))
  mu_z = E_{q(z|x)} x
  cov_z = E_{q(z|x)} x^2 - (E_{q(z|x)} x)^2
  kR_z = inv(choL(cov_z))
  
  Shapes
  ===
  x: (batch_size, input_dim)
  log_marg: (batch_size,)
  qz: (batch_size, num_clusters)
class_docstr_tok: ["log","p","(","x",")",">","=","E_","{","q","(","z|x",")","}","[","log","p","(","x|z",")","+","log","p","(","z",")","-","log","q","(","z|x",")","]","p","(","z",")","=","unif","p","(","x|z",")","=","N","(","x",";","mu_z",",","(","kR_z'kR_z",")","^-1",")","q","(","z|x",")","=","softmax","(","-0.5","*","(","kR_z","(","x-mu_z",")",")","^2","+logdet","(","kR_z",")","-0.5d","*","log","(","2","*","pi",")",")","mu_z","=","E_","{","q","(","z|x",")","}","x","cov_z","=","E_","{","q","(","z|x",")","}","x^2","-","(","E_","{","q","(","z|x",")","}","x",")","^2","kR_z","=","inv","(","choL","(","cov_z",")",")","Shapes","===","x",":","(","batch_size",",","input_dim",")","log_marg",":","(","batch_size",",",")","qz",":","(","batch_size",",","num_clusters",")"]
code: def __init__(
      self,
      *data_template,
      num_clusters,
      log_prior_=None,
      mu_=None,
      kR_=None,
      lr_mult=None,
      ctx=None,
      hybridize=None,
  ):
      super().__init__()
      self.input_dim = data_template[0].shape[1]
      self.num_clusters = num_clusters
  
      with self.name_scope():
          self.log_prior_ = self.params.get(
              "log_prior_",
              shape=(num_clusters,),
              lr_mult=lr_mult,
              init=mx.init.Constant(np.log(1 / self.num_clusters))
              if log_prior_ is None
              else mx.init.Constant(log_prior_),
          )
  
          self.mu_ = self.params.get(
              "mu_",
              shape=(self.num_clusters, self.input_dim),
              lr_mult=lr_mult,
              init=None if mu_ is None else mx.init.Constant(mu_),
          )
  
          self.kR_ = self.params.get(
              "kR_",
              shape=(self.num_clusters, self.input_dim, self.input_dim),
              lr_mult=lr_mult,
              init=None if kR_ is None else mx.init.Constant(kR_),
          )
  
      if hybridize:
          self.hybridize()
  
      self.initialize(ctx=ctx)
      self(*[mx.nd.array(x, ctx=ctx) for x in data_template])
  
file_path: gluonts/src/gluonts/nursery/gmm_tpp/gmm_base.py
imports: import time
  import mxnet
  from mxnet import gluon
  import numpy
label_desc: Use image node_id 1 to create a new GMMModel object from inherited base classes: gluon with example: obj = GMMModel()