(rate, variables=None)
return tf.group(*ops)
Create an Op that performs weight decay.
Create an Op that performs weight decay.
Create an Op that performs weight decay .
def weight_decay(rate, variables=None):
    """
    Create an Op that performs weight decay.
    """
    if variables is None:
        variables = tf.trainable_variables()
    ops = [tf.assign(var, var * rate) for var in variables]
    return tf.group(*ops)
def weight_decay ( rate , variables = None ) : if variables is None : variables = tf . trainable_variables ( ) ops = [ tf . assign ( var , var * rate ) for var in variables ] return tf . group ( * ops )