instance_norm

paddle.nn.functional. instance_norm ( x, running_mean=None, running_var=None, weight=None, bias=None, use_input_stats=True, momentum=0.9, eps=1e-05, data_format='NCHW', name=None ) [source]

It is recommended to use InstanceNorm1D , InstanceNorm2D , InstanceNorm3D to call this method internally.

Parameters
  • x (Tensor) – Input Tensor. It’s data type should be float32, float64.

  • running_mean (Tensor, optional) – running mean. Default None. Obsolete (that is, no longer usable).

  • running_var (Tensor, optional) – running variance. Default None. Obsolete (that is, no longer usable).

  • weight (Tensor, optional) – The weight tensor of instance_norm. Default: None. If its value is None, this parameter will be initialized by one.

  • bias (Tensor, optional) – The bias tensor of instance_norm. Default: None. If its value is None, this parameter will be initialized by zero.

  • eps (float, optional) – A value added to the denominator for numerical stability. Default is 1e-5.

  • momentum (float, optional) – The value used for the moving_mean and moving_var computation. Default: 0.9.

  • use_input_stats (bool, optional) – Default True. Obsolete (that is, no longer usable).

  • data_format (str, optional) – Specify the input data format, may be “NC”, “NCL”, “NCHW” or “NCDHW”. Defalut “NCHW”.

  • name (str, optional) – Name for the InstanceNorm, default is None. For more information, please refer to Name..

Returns

None.

Examples

import paddle

x = paddle.rand((2, 2, 2, 3))
instance_norm_out = paddle.nn.functional.instance_norm(x)

print(instance_norm_out)