class_docstr: Fully factorized distribution based on neural network cumulative.
  
  This is a flexible, nonparametric probability density model, described in
  appendix 6.1 of the paper:
  
  > "Variational image compression with a scale hyperprior"<br />
  > J. Ballé, D. Minnen, S. Singh, S. J. Hwang, N. Johnston<br />
  > https://openreview.net/forum?id=rkcQFMZRb
  
  but *without* convolution with a unit-width uniform
  density, as described in appendix 6.2 of the same paper. Please cite the paper
  if you use this code for scientific work.
  
  This is a scalar distribution (i.e., its `event_shape` is always length 0),
  and the density object always creates its own `tf.Variable`s representing the
  trainable distribution parameters.
class_docstr_tok: ["Fully","factorized","distribution","based","on","neural","network","cumulative",".","This","is","a","flexible",",","nonparametric","probability","density","model",",","described","in","appendix","6.1","of","the","paper",":",">","``","Variational","image","compression","with","a","scale","hyperprior","''","<","br","\/",">",">","J.","Ball\u00e9",",","D.","Minnen",",","S.","Singh",",","S.","J.","Hwang",",","N.","Johnston","<","br","\/",">",">","https",":","\/\/openreview.net\/forum","?","id=rkcQFMZRb","but","*","without","*","convolution","with","a","unit-width","uniform","density",",","as","described","in","appendix","6.2","of","the","same","paper",".","Please","cite","the","paper","if","you","use","this","code","for","scientific","work",".","This","is","a","scalar","distribution","(","i.e.",",","its","`","event_shape","`","is","always","length","0",")",",","and","the","density","object","always","creates","its","own","`","tf.Variable","`","s","representing","the","trainable","distribution","parameters","."]
docstr: Initializer.
  
  Args:
    batch_shape: Iterable of integers. The desired batch shape for the
      `Distribution` (rightmost dimensions which are assumed independent, but
      not identically distributed).
    num_filters: Iterable of integers. The number of filters for each of the
      hidden layers. The first and last layer of the network implementing the
      cumulative distribution are not included (they are assumed to be 1).
    init_scale: Float. Scale factor for the density at initialization. It is
      recommended to choose a large enough scale factor such that most values
      initially lie within a region of high likelihood. This improves
      training.
    allow_nan_stats: Boolean. Whether to allow `NaN`s to be returned when
      querying distribution statistics.
    dtype: A floating point `tf.dtypes.DType`. Computations relating to this
      distribution will be performed at this precision.
    name: String. A name for this distribution.
docstr_tok: ["Initializer",".","Args",":","batch_shape",":","Iterable","of","integers",".","The","desired","batch","shape","for","the","`","Distribution","`","(","rightmost","dimensions","which","are","assumed","independent",",","but","not","identically","distributed",")",".","num_filters",":","Iterable","of","integers",".","The","number","of","filters","for","each","of","the","hidden","layers",".","The","first","and","last","layer","of","the","network","implementing","the","cumulative","distribution","are","not","included","(","they","are","assumed","to","be","1",")",".","init_scale",":","Float",".","Scale","factor","for","the","density","at","initialization",".","It","is","recommended","to","choose","a","large","enough","scale","factor","such","that","most","values","initially","lie","within","a","region","of","high","likelihood",".","This","improves","training",".","allow_nan_stats",":","Boolean",".","Whether","to","allow","`","NaN","`","s","to","be","returned","when","querying","distribution","statistics",".","dtype",":","A","floating","point","`","tf.dtypes.DType","`",".","Computations","relating","to","this","distribution","will","be","performed","at","this","precision",".","name",":","String",".","A","name","for","this","distribution","."]
code: def __init__(
      self,
      batch_shape=(),
      num_filters=(3, 3),
      init_scale=10,
      allow_nan_stats=False,
      dtype=tf.float32,
      name="DeepFactorized",
  ):
      """Initializer.
  
      Args:
        batch_shape: Iterable of integers. The desired batch shape for the
          `Distribution` (rightmost dimensions which are assumed independent, but
          not identically distributed).
        num_filters: Iterable of integers. The number of filters for each of the
          hidden layers. The first and last layer of the network implementing the
          cumulative distribution are not included (they are assumed to be 1).
        init_scale: Float. Scale factor for the density at initialization. It is
          recommended to choose a large enough scale factor such that most values
          initially lie within a region of high likelihood. This improves
          training.
        allow_nan_stats: Boolean. Whether to allow `NaN`s to be returned when
          querying distribution statistics.
        dtype: A floating point `tf.dtypes.DType`. Computations relating to this
          distribution will be performed at this precision.
        name: String. A name for this distribution.
      """
      parameters = dict(locals())
      self._batch_shape_tuple = tuple(int(s) for s in batch_shape)
      self._num_filters = tuple(int(f) for f in num_filters)
      self._init_scale = float(init_scale)
      super().__init__(
          dtype=dtype,
          reparameterization_type=tfp.distributions.NOT_REPARAMETERIZED,
          validate_args=False,
          allow_nan_stats=allow_nan_stats,
          parameters=parameters,
          name=name,
      )
      with self.name_scope:
          self._make_variables()
  
imports: import tensorflow
  import tensorflow_probability
  from tensorflow_compression.python.distributions import helpers
  from tensorflow_compression.python.distributions import uniform_noise
label_desc: Use image node_id 1 to create a new DeepFactorized object from inherited base classes: tfp.distributions with example: obj = DeepFactorized(batch_shape, num_filters, init_scale, allow_nan_stats, dtype, name)