class_docstr: Instance normalization layer (specification key: `instance_normalization`).
  
  Args:
      axes (iter[int >= 0]): Normalization axes, excluding batch axis
          (<span style="color:#00C000"><b>default</b></span>: all input axes).
      only_mean (bool): Whether to normalize only with respect to mean, not variance
          (<span style="color:#00C000"><b>default</b></span>: false).
      min_variance (float > 0.0): Clip variance lower than minimum
          (<span style="color:#00C000"><b>default</b></span>: 1e-4).
      name (string): Layer name
          (<span style="color:#00C000"><b>default</b></span>: internally chosen).
      input_spec (specification): <span style="color:#00C000"><b>internal use</b></span>.
class_docstr_tok: ["Instance","normalization","layer","(","specification","key",":","`","instance_normalization","`",")",".","Args",":","axes","(","iter","[","int",">","=","0","]",")",":","Normalization","axes",",","excluding","batch","axis","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","all","input","axes",")",".","only_mean","(","bool",")",":","Whether","to","normalize","only","with","respect","to","mean",",","not","variance","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","false",")",".","min_variance","(","float",">","0.0",")",":","Clip","variance","lower","than","minimum","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","1e-4",")",".","name","(","string",")",":","Layer","name","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","internally","chosen",")",".","input_spec","(","specification",")",":","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","internal","use","<","\/b",">","<","\/span",">","."]
code: def apply(self, *, x):
      axes = tuple(1 + axis for axis in self.axes)
  
      if self.only_mean:
          mean = tf.math.reduce_mean(
              input_tensor=x, axis=axes, keepdims=True
          )
  
          return x - tf.stop_gradient(input=mean)
  
      else:
          mean, variance = tf.nn.moments(x=x, axes=axes, keepdims=True)
  
          min_variance = tf_util.constant(
              value=self.min_variance, dtype="float"
          )
          reciprocal_stddev = tf.math.rsqrt(
              x=tf.maximum(x=variance, y=min_variance)
          )
  
          return (x - tf.stop_gradient(input=mean)) * tf.stop_gradient(
              input=reciprocal_stddev
          )
  
imports: import numpy
  import tensorflow
  from tensorforce import TensorforceError
  from tensorforce.core import parameter_modules, TensorSpec, tf_function, tf_util
  from tensorforce.core.layers import Layer, StatefulLayer
label_desc: Use image node_id 3 for calling the InstanceNormalization obj's underlying member method code with example usage: obj.apply() and returns: unknown, unknown