def maxnorm_i_regularizer(scale):
if isinstance(scale, numbers.Integral):<EOL><INDENT>raise ValueError('<STR_LIT>' % scale)<EOL><DEDENT>if isinstance(scale, numbers.Real):<EOL><INDENT>if scale < <NUM_LIT:0.>:<EOL><INDENT>raise ValueError('<STR_LIT>' % scale)<EOL><DEDENT>if scale == <NUM_LIT:0.>:<EOL><INDENT>tl.logging.info('<STR_LIT>')<EOL>return lambda _, name=None: None<EOL><DEDENT><DEDENT>def mn_i(weights, name='<STR_LIT>'):<EOL><INDENT>"""<STR_LIT>"""<EOL>with tf.name_scope(name) as scope:<EOL><INDENT>my_scale = ops.convert_to_tensor(scale, dtype=weights.dtype.base_dtype, name='<STR_LIT>')<EOL>if tf.__version__ <= '<STR_LIT>':<EOL><INDENT>standard_ops_fn = standard_ops.mul<EOL><DEDENT>else:<EOL><INDENT>standard_ops_fn = standard_ops.multiply<EOL><DEDENT>return standard_ops_fn(<EOL>my_scale, standard_ops.reduce_sum(standard_ops.reduce_max(standard_ops.abs(weights), <NUM_LIT:1>)), name=scope<EOL>)<EOL><DEDENT><DEDENT>return mn_i<EOL>
Max-norm input regularization removes the neurons of previous layer.
    Returns a function that can be used to apply max-norm regularization to each row of weight matrix.
    The implementation follows `TensorFlow contrib <https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/layers/python/layers/regularizers.py>`__.

    Parameters
    ----------
    scale : float
        A scalar multiplier `Tensor`. 0.0 disables the regularizer.

    Returns
    ---------
    A function with signature `mn_i(weights, name=None)` that apply Lo regularization.

    Raises
    ---------
    ValueError : If scale is outside of the range [0.0, 1.0] or if scale is not a float.