def normalized_mean_square_error(output, target, name="<STR_LIT>"):
<EOL>if output.get_shape().ndims == <NUM_LIT:2>:  <EOL><INDENT>nmse_a = tf.sqrt(tf.reduce_sum(tf.squared_difference(output, target), axis=<NUM_LIT:1>))<EOL>nmse_b = tf.sqrt(tf.reduce_sum(tf.square(target), axis=<NUM_LIT:1>))<EOL><DEDENT>elif output.get_shape().ndims == <NUM_LIT:3>:  <EOL><INDENT>nmse_a = tf.sqrt(tf.reduce_sum(tf.squared_difference(output, target), axis=[<NUM_LIT:1>, <NUM_LIT:2>]))<EOL>nmse_b = tf.sqrt(tf.reduce_sum(tf.square(target), axis=[<NUM_LIT:1>, <NUM_LIT:2>]))<EOL><DEDENT>elif output.get_shape().ndims == <NUM_LIT:4>:  <EOL><INDENT>nmse_a = tf.sqrt(tf.reduce_sum(tf.squared_difference(output, target), axis=[<NUM_LIT:1>, <NUM_LIT:2>, <NUM_LIT:3>]))<EOL>nmse_b = tf.sqrt(tf.reduce_sum(tf.square(target), axis=[<NUM_LIT:1>, <NUM_LIT:2>, <NUM_LIT:3>]))<EOL><DEDENT>nmse = tf.reduce_mean(nmse_a / nmse_b, name=name)<EOL>return nmse<EOL>
Return the TensorFlow expression of normalized mean-square-error of two distributions.

    Parameters
    ----------
    output : Tensor
        2D, 3D or 4D tensor i.e. [batch_size, n_feature], [batch_size, height, width] or [batch_size, height, width, channel].
    target : Tensor
        The target distribution, format the same with `output`.
    name : str
        An optional name to attach to this function.