class_docstr: Keras `Layer` to parameterize a Pixel CNN++ distribution.
  This is a Keras implementation of the Pixel CNN++ network, as described in
  Salimans et al. (2017)[1] and van den Oord et al. (2016)[2].
  (https://github.com/openai/pixel-cnn).
  #### References
  [1]: Tim Salimans, Andrej Karpathy, Xi Chen, and Diederik P. Kingma.
     PixelCNN++: Improving the PixelCNN with Discretized Logistic Mixture
     Likelihood and Other Modifications. In _International Conference on
     Learning Representations_, 2017.
     https://pdfs.semanticscholar.org/9e90/6792f67cbdda7b7777b69284a81044857656.pdf
     Additional details at https://github.com/openai/pixel-cnn
  [2]: Aaron van den Oord, Nal Kalchbrenner, Oriol Vinyals, Lasse Espeholt,
     Alex Graves, and Koray Kavukcuoglu. Conditional Image Generation with
     PixelCNN Decoders. In _30th Conference on Neural Information Processing
     Systems_, 2016.
     https://papers.nips.cc/paper/6527-conditional-image-generation-with-pixelcnn-decoders.pdf.
class_docstr_tok: ["Keras","`","Layer","`","to","parameterize","a","Pixel","CNN++","distribution",".","This","is","a","Keras","implementation","of","the","Pixel","CNN++","network",",","as","described","in","Salimans","et","al",".","(","2017",")","[","1","]","and","van","den","Oord","et","al",".","(","2016",")","[","2","]",".","(","https",":","\/\/github.com\/openai\/pixel-cnn",")",".","#","#","#","#","References","[","1","]",":","Tim","Salimans",",","Andrej","Karpathy",",","Xi","Chen",",","and","Diederik","P.","Kingma",".","PixelCNN++",":","Improving","the","PixelCNN","with","Discretized","Logistic","Mixture","Likelihood","and","Other","Modifications",".","In","_International","Conference","on","Learning","Representations_",",","2017.","https",":","\/\/pdfs.semanticscholar.org\/9e90\/6792f67cbdda7b7777b69284a81044857656.pdf","Additional","details","at","https",":","\/\/github.com\/openai\/pixel-cnn","[","2","]",":","Aaron","van","den","Oord",",","Nal","Kalchbrenner",",","Oriol","Vinyals",",","Lasse","Espeholt",",","Alex","Graves",",","and","Koray","Kavukcuoglu",".","Conditional","Image","Generation","with","PixelCNN","Decoders",".","In","_30th","Conference","on","Neural","Information","Processing","Systems_",",","2016.","https",":","\/\/papers.nips.cc\/paper\/6527-conditional-image-generation-with-pixelcnn-decoders.pdf","."]
docstr: Initialize the neural network for the Pixel CNN++ distribution.
  
  Parameters
  ----------
  dropout_p
      `float`, the dropout probability. Should be between 0 and 1.
  num_resnet
      `int`, the number of layers (shown in Figure 2 of [2]) within
      each highest-level block of Figure 2 of [1].
  num_hierarchies
      `int`, the number of hightest-level blocks (separated by
      expansions/contractions of dimensions in Figure 2 of [1].)
  num_filters
      `int`, the number of convolutional filters.
  num_logistic_mix
      `int`, number of components in the logistic mixture
      distribution.
  receptive_field_dims
      `tuple`, height and width in pixels of the receptive
      field of the convolutional layers above and to the left of a given
      pixel. The width (second element of the tuple) should be odd. Figure 1
      (middle) of [2] shows a receptive field of (3, 5) (the row containing
      the current pixel is included in the height). The default of (3, 3) was
      used to produce the results in [1].
  resnet_activation
      `string`, the type of activation to use in the resnet
      blocks. May be 'concat_elu', 'elu', or 'relu'.
  l2_weight
      `float`, the L2 regularization weight.
  use_weight_norm
      `bool`, if `True` then use weight normalization.
  use_data_init
      `bool`, if `True` then use data-dependent initialization
      (has no effect if `use_weight_norm` is `False`).
  dtype
      Data type of the layer.
code: def __init__(
      self,
      dropout_p: float = 0.5,
      num_resnet: int = 5,
      num_hierarchies: int = 3,
      num_filters: int = 160,
      num_logistic_mix: int = 10,
      receptive_field_dims: tuple = (3, 3),
      resnet_activation: str = "concat_elu",
      l2_weight: float = 0.0,
      use_weight_norm: bool = True,
      use_data_init: bool = True,
      dtype=tf.float32,
  ) -> None:
      """Initialize the neural network for the Pixel CNN++ distribution.
  
      Parameters
      ----------
      dropout_p
          `float`, the dropout probability. Should be between 0 and 1.
      num_resnet
          `int`, the number of layers (shown in Figure 2 of [2]) within
          each highest-level block of Figure 2 of [1].
      num_hierarchies
          `int`, the number of hightest-level blocks (separated by
          expansions/contractions of dimensions in Figure 2 of [1].)
      num_filters
          `int`, the number of convolutional filters.
      num_logistic_mix
          `int`, number of components in the logistic mixture
          distribution.
      receptive_field_dims
          `tuple`, height and width in pixels of the receptive
          field of the convolutional layers above and to the left of a given
          pixel. The width (second element of the tuple) should be odd. Figure 1
          (middle) of [2] shows a receptive field of (3, 5) (the row containing
          the current pixel is included in the height). The default of (3, 3) was
          used to produce the results in [1].
      resnet_activation
          `string`, the type of activation to use in the resnet
          blocks. May be 'concat_elu', 'elu', or 'relu'.
      l2_weight
          `float`, the L2 regularization weight.
      use_weight_norm
          `bool`, if `True` then use weight normalization.
      use_data_init
          `bool`, if `True` then use data-dependent initialization
          (has no effect if `use_weight_norm` is `False`).
      dtype
          Data type of the layer.
      """
      super(_PixelCNNNetwork, self).__init__(dtype=dtype)
      self._dropout_p = dropout_p
      self._num_resnet = num_resnet
      self._num_hierarchies = num_hierarchies
      self._num_filters = num_filters
      self._num_logistic_mix = num_logistic_mix
      self._receptive_field_dims = receptive_field_dims  # first set desired receptive field, then infer kernel
      self._resnet_activation = resnet_activation
      self._l2_weight = l2_weight
  
      if use_weight_norm:
  
          def layer_wrapper(layer):
              def wrapped_layer(*args, **kwargs):
                  return WeightNorm(
                      layer(*args, **kwargs), data_init=use_data_init
                  )
  
              return wrapped_layer
  
          self._layer_wrapper = layer_wrapper
      else:
          self._layer_wrapper = lambda layer: layer
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import numpy
  import warnings
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import logistic
  from tensorflow_probability.python.distributions import mixture_same_family
  from tensorflow_probability.python.distributions import quantized_distribution
  from tensorflow_probability.python.distributions import transformed_distribution
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
label_desc: Use image node_id 1 to create a new _PixelCNNNetwork object from inherited base classes: tf.keras.layers with example: obj = _PixelCNNNetwork(dropout_p, num_resnet, num_hierarchies, num_filters, num_logistic_mix, receptive_field_dims, resnet_activation, l2_weight, use_weight_norm, use_data_init, dtype)