tfsnippet.layers

tfsnippet.layers Package

Functions

act_norm(*args, **kwargs) ActNorm proposed by (Kingma & Dhariwal, 2018).
as_gated(layer_fn[, sigmoid_bias, default_name]) Wrap a layer function into a gated layer function.
avg_pool2d(*args, **kwargs) 2D average pooling over spatial dimensions.
broadcast_log_det_against_input(log_det, …) Broadcast the shape of log_det to match the shape of input.
conv2d(*args, **kwargs) 2D convolutional layer.
deconv2d(*args, **kwargs) 2D deconvolutional layer.
default_kernel_initializer([weight_norm]) Get the default initializer for layer kernels (i.e., W of layers).
dense(*args, **kwargs) Fully-connected layer.
dropout(*args, **kwargs) Apply dropout on input.
global_avg_pool2d(*args, **kwargs) 2D global average pooling over spatial dimensions.
l2_regularizer(lambda_[, name]) Construct an L2 regularizer that computes the L2 regularization loss.
max_pool2d(*args, **kwargs) 2D max pooling over spatial dimensions.
pixelcnn_2d_input(*args, **kwargs) Prepare the input for a PixelCNN 2D network (Tim Salimans, 2017).
pixelcnn_2d_output(input) Get the final output of a PixelCNN 2D network from the previous layer.
pixelcnn_conv2d_resnet(*args, **kwargs) PixelCNN 2D convolutional ResNet block.
planar_normalizing_flows([n_layers, …]) Construct a sequential of :class`PlanarNormalizingFlow`.
resnet_conv2d_block(*args, **kwargs) 2D convolutional ResNet block.
resnet_deconv2d_block(*args, **kwargs) 2D deconvolutional ResNet block.
resnet_general_block(*args, **kwargs) A general implementation of ResNet block.
shifted_conv2d(*args, **kwargs) 2D convolution with shifted input.
weight_norm(*args, **kwargs) Weight normalization proposed by (Salimans & Kingma, 2016).

Classes

ActNorm([axis, value_ndims, initialized, …]) ActNorm proposed by (Kingma & Dhariwal, 2018).
BaseFlow(x_value_ndims[, y_value_ndims, …]) The basic class for normalizing flows.
BaseLayer([name, scope]) Base class for all neural network layers.
CouplingLayer(shift_and_scale_fn[, axis, …]) A general implementation of the coupling layer (Dinh et al., 2016).
FeatureMappingFlow(axis, value_ndims, **kwargs) Base class for flows mapping input features to output features.
FeatureShufflingFlow([axis, value_ndims, …]) An invertible flow which shuffles the order of input features.
InvertFlow(flow[, name, scope]) Turn a BaseFlow into its inverted flow.
InvertibleActivation Base class for intertible activation functions.
InvertibleActivationFlow(activation, value_ndims) A flow that converts a InvertibleActivation into a flow.
InvertibleConv2d([channels_last, …]) Invertible 1x1 2D convolution proposed in (Kingma & Dhariwal, 2018).
InvertibleDense([strict_invertible, …]) Invertible dense layer, modified from the invertible 1x1 2d convolution proposed in (Kingma & Dhariwal, 2018).
LeakyReLU([alpha]) Leaky ReLU activation function.
MultiLayerFlow(n_layers, **kwargs) Base class for multi-layer normalizing flows.
PixelCNN2DOutput(vertical, horizontal) The output of a PixelCNN 2D layer, including tensors from the vertical and horizontal convolution stacks.
PlanarNormalizingFlow([w_initializer, …]) A single layer Planar Normalizing Flow (Danilo 2016) with tanh activation function, as well as the invertible trick.
ReshapeFlow(x_value_ndims, y_value_shape[, …]) A flow which reshapes the last x_value_ndims of x into y_value_shape.
SequentialFlow(flows[, name, scope]) Compose a large flow from a sequential of BaseFlow.
SpaceToDepthFlow(block_size[, …]) A flow which computes y = space_to_depth(x), and conversely x = depth_to_space(y).
SplitFlow(split_axis, left[, join_axis, …]) A flow which splits input x into halves, apply different flows on each half, then concat the output together.

Class Inheritance Diagram

Inheritance diagram of tfsnippet.layers.normalization.act_norm_.ActNorm, tfsnippet.layers.flows.base.BaseFlow, tfsnippet.layers.base.BaseLayer, tfsnippet.layers.flows.coupling.CouplingLayer, tfsnippet.layers.flows.base.FeatureMappingFlow, tfsnippet.layers.flows.rearrangement.FeatureShufflingFlow, tfsnippet.layers.flows.invert.InvertFlow, tfsnippet.layers.activations.base.InvertibleActivation, tfsnippet.layers.activations.base.InvertibleActivationFlow, tfsnippet.layers.flows.linear.InvertibleConv2d, tfsnippet.layers.flows.linear.InvertibleDense, tfsnippet.layers.activations.leaky_relu.LeakyReLU, tfsnippet.layers.flows.base.MultiLayerFlow, tfsnippet.layers.convolutional.pixelcnn.PixelCNN2DOutput, tfsnippet.layers.flows.planar_nf.PlanarNormalizingFlow, tfsnippet.layers.flows.reshape.ReshapeFlow, tfsnippet.layers.flows.sequential.SequentialFlow, tfsnippet.layers.flows.reshape.SpaceToDepthFlow, tfsnippet.layers.flows.branch.SplitFlow