Table Of Contents
The InstanceNormalizePlugin
is used for the InstanceNormalization layer, which is generally used in deep learning models that perform image generation. This plugin is based off the ONNX opset 6 definition, and is used in any ONNX model that uses this operation.
Specifically, given an array of values x = [x_0, x_1, ..., x_n]
, a scale factor, a bias factor, and an epislon, the InstanceNormalization of x is scale * (x-mean) / sqrt(variance + epsilon) + bias
where the mean and variance are computed per instance per channel.
This plugin takes one input and generates one output. The first input is the data from the last layer that is going to be normalized. It has a shape of [N, C, H, W]
, where N
is the batch size, C
is the number of channels, H
is the height, W
is the width.
The dimensions of the output are exactly the same as the input.
This plugin consists of the plugin creator class InstanceNormalizationPluginCreator
and the plugin class InstanceNormalizationPlugin
. To create the plugin instance, the following parameters are used:
Type | Parameter | Description |
---|---|---|
float |
epsilon |
A small number to prevent being divided by zero during normalization. |
Weights * |
scale |
A pointer to weights which contains information about scale factors for normalization. The definition of Weights can be found in the NvInfer.h header. |
Weights * |
bias |
A pointer to weights which contains information about the bias values for normalization. The definition of Weights can be found in the NvInfer.h header. |
int |
relu |
A value used to enable leaky relu activation |
float |
alpha |
A small negative slope for the leaky relu activation |
The following resources provide a deeper understanding of the InstanceNormalizationPlugin
plugin:
Networks
For terms and conditions for use, reproduction, and distribution, see the TensorRT Software License Agreement documentation.
September 2019
This is the first release of this README.md
file.
There are no known issues in this plugin.