MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / l2

Function l2

modelzoo/ple/train.py:103–106  ·  view source on GitHub ↗
(weights)

Source from the content-addressed store, hash-verified

101 return lambda _: None
102
103 def l2(weights):
104 with tf.name_scope(scope, 'l2_regularizer', [weights]) as name:
105 my_scale = tf.convert_to_tensor(scale, dtype=weights.dtype.base_dtype, name='scale')
106 return tf.math.multiply(my_scale, tf.nn.l2_loss(weights), name=name)
107
108 return l2
109

Callers

nothing calls this directly

Calls 2

multiplyMethod · 0.80
name_scopeMethod · 0.45

Tested by

no test coverage detected